Docker - Nifi:1.14.0 - 启动失败 - 导致:org.apache.nifi.properties.SensitivePropertyProtectionException

1 docker docker-compose apache-nifi

您好,我对 docker 和 nifi 完全陌生,我需要在 docker 上设置 nifi,但我收到以下错误。

下面的错误文本或(错误的屏幕截图 - 在终端上)

nifi01_1   | 2021-09-17 02:12:30,707 INFO [main] o.a.nifi.properties.NiFiPropertiesLoader Loaded 202 properties from /opt/nifi/nifi-current/./conf/nifi.properties
nifi01_1   | 2021-09-17 02:12:30,719 ERROR [main] o.a.nifi.properties.NiFiPropertiesLoader Clustered Configuration Found: Shared Sensitive Properties Key [nifi.sensitive.props.key] required for cluster nodes
nifi01_1   | 2021-09-17 02:12:30,723 ERROR [main] org.apache.nifi.NiFi Failure to launch NiFi due to java.lang.IllegalArgumentException: There was an issue decrypting protected properties
nifi01_1   | java.lang.IllegalArgumentException: There was an issue decrypting protected properties
nifi01_1   |    at org.apache.nifi.NiFi.initializeProperties(NiFi.java:346)
nifi01_1   |    at org.apache.nifi.NiFi.convertArgumentsToValidatedNiFiProperties(NiFi.java:314)
nifi01_1   |    at org.apache.nifi.NiFi.convertArgumentsToValidatedNiFiProperties(NiFi.java:310)
nifi01_1   |    at org.apache.nifi.NiFi.main(NiFi.java:302)
nifi01_1   | Caused by: org.apache.nifi.properties.SensitivePropertyProtectionException: Sensitive Properties Key [nifi.sensitive.props.key] not found: See Admin Guide section [Updating the Sensitive Properties Key]
nifi01_1   |    at org.apache.nifi.properties.NiFiPropertiesLoader.getDefaultProperties(NiFiPropertiesLoader.java:220)
nifi01_1   |    at org.apache.nifi.properties.NiFiPropertiesLoader.get(NiFiPropertiesLoader.java:209)
nifi01_1   |    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
nifi01_1   |    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
nifi01_1   |    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
nifi01_1   |    at java.lang.reflect.Method.invoke(Method.java:498)
nifi01_1   |    at org.apache.nifi.NiFi.initializeProperties(NiFi.java:341)
nifi01_1   |    ... 3 common frames omitted
nifi01_1 exited with code 0
Run Code Online (Sandbox Code Playgroud)

docker-compose.yml:

#    Licensed to the Apache Software Foundation (ASF) under one or more
#    contributor license agreements.  See the NOTICE file distributed with
#    this work for additional information regarding copyright ownership.
#    The ASF licenses this file to You under the Apache License, Version 2.0
#    (the "License"); you may not use this file except in compliance with
#    the License.  You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.

version: "3"
services:
  zookeeper:
    hostname: zookeeper
    container_name: zookeeper
    image: 'bitnami/zookeeper:latest'
    environment:
      - ALLOW_ANONYMOUS_LOGIN=yes
    networks:
      - nifinet
  nifi01:
    image: apache/nifi:1.14.0
    ports:
      - 6980:8080 # Unsecured HTTP Web Port
    networks:
      - nifinet
    environment:
      - NIFI_WEB_HTTP_PORT=8080
      - NIFI_CLUSTER_IS_NODE=true
      - NIFI_CLUSTER_NODE_PROTOCOL_PORT=8082
      - NIFI_ZK_CONNECT_STRING=zookeeper:2181
      - NIFI_ELECTION_MAX_WAIT=1 min
  nifi02:
    image: apache/nifi:1.14.0
    ports:
      - 6979:8080 # Unsecured HTTP Web Port
    networks:
      - nifinet
    environment:
      - NIFI_WEB_HTTP_PORT=8080
      - NIFI_CLUSTER_IS_NODE=true
      - NIFI_CLUSTER_NODE_PROTOCOL_PORT=8082
      - NIFI_ZK_CONNECT_STRING=zookeeper:2181
      - NIFI_ELECTION_MAX_WAIT=1 min
  nifi03:
    image: apache/nifi:1.14.0
    ports:
      - 6978:8080 # Unsecured HTTP Web Port
    networks:
      - nifinet
    environment:
      - NIFI_WEB_HTTP_PORT=8080
      - NIFI_CLUSTER_IS_NODE=true
      - NIFI_CLUSTER_NODE_PROTOCOL_PORT=8082
      - NIFI_ZK_CONNECT_STRING=zookeeper:2181
      - NIFI_ELECTION_MAX_WAIT=1 min
networks:
  nifinet:
    driver: bridge
Run Code Online (Sandbox Code Playgroud)

根据我的研究,有人提到我必须更新 nifi.properties 中的一些属性,但不确定如何在 docker 映像上设置它们。请帮忙。

The*_*heo 6

只需将NIFI_SENSITIVE_PROPS_KEY环境变量添加到 docker-copmose 文件 nifis 中即可。它可以是随机字符串,但请确保它至少有 12 个字符长(否则 NiFi 将不会接受)。