嗨,我对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
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
根据我的研究,有人提到我必须更新nifi中的一些属性。属性,但不确定如何在docker映像上设置它们。请帮助。
将NIFI_SENSITIVE_PROPS_KEY
作为环境变量添加到您的docker- commose文件nifis中。它可以是一个随机字符串,但要确保它至少有12个字符长(否则NiFi将不接受它)。