简体   繁体   English

第二个节点无法绑定到 Apache Nifi 集群

[英]Second node failed to bind to Apache Nifi cluster

I have deployed two apache nifi nodes in Kubernetes.我在 Kubernetes 中部署了两个 apache nifi 节点。 Apache nifi has statefulset kind in the yaml file. Apache nifi 在 yaml 文件中有 statefulset 种类。

The second node "nifi-1" raise an error, in the pod corresponding logs I have the following:第二个节点“nifi-1”引发错误,在 pod 对应的日志中我有以下内容:

2022-12-21 18:48:16,852 WARN [main] org.apache.nifi.web.server.JettyServer Failed to start web server... shutting down.
java.io.IOException: Failed to bind to nifi-0.nifi.namespacenifi-01.svc.cluster.local/10.233.79.58:8080
 at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:349)
 at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:310)
 at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
 at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:234)
 at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
 at org.eclipse.jetty.server.Server.doStart(Server.java:401)
 at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
 at org.apache.nifi.web.server.JettyServer.start(JettyServer.java:812)
 at org.apache.nifi.NiFi.<init>(NiFi.java:172)
 at org.apache.nifi.NiFi.<init>(NiFi.java:83)
 at org.apache.nifi.NiFi.main(NiFi.java:332)
Caused by: java.net.BindException: Cannot assign requested address
 at sun.nio.ch.Net.bind0(Native Method)
 at sun.nio.ch.Net.bind(Net.java:461)
 at sun.nio.ch.Net.bind(Net.java:453)
 at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:222)
 at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:85)
 at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:344)
 ... 10 common frames omitted
2022-12-21 18:48:16,853 INFO [Thread-1] org.apache.nifi.NiFi Application Server shutdown started

I don't know what I missed.我不知道我错过了什么。 The Seconde node nifi-1 failed to connect. Seconde节点nifi-1连接失败。 When I have one node it works well but when the second node is deployed I have the error above that I don't understand.当我有一个节点时,它运行良好,但是当部署第二个节点时,我有上面的错误,我不明白。

yaml for nifi: nifi 的 yaml:

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: nifi
  labels:
    name: nifi
    app: nifi
  annotations:
    app.kubernetes.io/name: nifi
    app.kubernetes.io/part-of: nifi
spec:
  serviceName: nifi
  replicas: 2
  revisionHistoryLimit: 1
  selector:
    matchLabels:
      app: nifi
  template:
    metadata:
      labels:
        app: nifi
    spec:
      automountServiceAccountToken: false
      enableServiceLinks: false
      restartPolicy: Always
      securityContext:
        runAsGroup: 1000
        runAsUser: 1000
        runAsNonRoot: true
        seccompProfile:
          type: RuntimeDefault
      containers:
      - name: nifi
        image: XXX
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 8080
          name: nifi
        - containerPort: 8082
          name: cluster
        env:
        - name: "NIFI_SENSITIVE_PROPS_KEY"
          value: "nificluster"
        - name: NIFI_WEB_HTTP_HOST
          valueFrom:
             fieldRef:
               fieldPath: status.podIP
        - name: NIFI_WEB_HTTP_PORT
          value: "8080"
        - name: NIFI_ANALYTICS_PREDICT_ENABLED
          value: "true"
        - name: NIFI_ELECTION_MAX_CANDIDATES
          value: "2"
        - name: NIFI_ELECTION_MAX_WAIT
          value: "1 min"
        - name: NIFI_CLUSTER_IS_NODE
          value: "true"
        - name: NIFI_JVM_HEAP_INIT
          value: "3g"
        - name: NIFI_JVM_HEAP_MAX
          value: "4g"
        - name: NIFI_CLUSTER_NODE_CONNECTION_TIMEOUT
          value: "2 min"
        - name: NIFI_CLUSTER_PROTOCOL_CONNECTION_HANDSHAKE_TIMEOUT
          value: "2 min"        
        - name: NIFI_CLUSTER_NODE_PROTOCOL_MAX_THREADS
          value: "15"
        - name: NIFI_CLUSTER_NODE_PROTOCOL_PORT
          value: "8082"
        - name: NIFI_CLUSTER_NODE_READ_TIMEOUT
          value: "15"
        - name: NIFI_ZK_CONNECT_STRING
          value: "zookeeper:2181"
        - name: NIFI_CLUSTER_PROTOCOL_IS_SECURE
          value: "false"
        - name: NIFI_CLUSTER_NODE_ADDRESS
          valueFrom:
             fieldRef:
               fieldPath: status.podIP
        # - name: HOSTNAME
        #   valueFrom:
        #     fieldRef:
        #       fieldPath: status.podIP
        livenessProbe:
          exec:
            command:
              - pgrep
              - java
          initialDelaySeconds: 60
          periodSeconds: 30
          timeoutSeconds: 10
          failureThreshold: 3
          successThreshold: 1
        readinessProbe:
          exec:
            command:
              - pgrep
              - java
          initialDelaySeconds: 180
          periodSeconds: 30
          timeoutSeconds: 10
          failureThreshold: 3
          successThreshold: 1
        resources:
          requests:
            cpu: 400m
            memory: 1Gi
          limits:
            cpu: 500m
            memory: 2Gi
      volumes:
        - name: pv--01
          persistentVolumeClaim:
            claimName: pv-claim

Usually this error occurs when the folders pointed to by nifi.nar.library.directory.* was inaccessible, eg the Symbolic links were no longer valid due to file system changes.当 nifi.nar.library.directory.* 指向的文件夹不可访问时,通常会发生此错误,例如,由于文件系统更改,符号链接不再有效。

As stated, the referenced location may be inaccessible, be it permissions or broken links.如前所述,引用的位置可能无法访问,无论是权限还是断开的链接。 Correct permissions or links and service will start fine正确的权限或链接和服务将正常启动

Or Try running the below commands:或者尝试运行以下命令:

sudo chown -R nifi:nifi /opt/nifi/
sudo service nifi start 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 重启 NiFi 节点作为新节点加入集群 - Restarting NiFi Node Joins Cluster as New Node AKS 中的 Kubernetes NiFi 集群设置 - Kubernetes NiFi Cluster setup in AKS 加入worker节点时读取集群ca证书失败 - Failed to read cluster ca certificate when joining worker node Apache Nifi 是否准备好在生产中与 Kube.netes 一起使用? - Is Apache Nifi ready to use with Kubernetes in production? kubelet.service:单元输入失败 state 未准备好 state 节点错误来自 kubernetes 集群 - kubelet.service: Unit entered failed state in not ready state node error from kubernetes cluster 节点池集群未自动缩放 - Node pool cluster is not autoscaling Kubernetes 上的 Apache Ignite 未加入集群 - Apache Ignite on Kubernetes not joining cluster apache nifi 1.15.0 敏感属性导致启动失败 - apache nifi 1.15.0 startup failure caused by sensitive property 由于java.net.UnknownHostException,单节点kubernetes集群上的spark-examples作业失败:kubernetes.default.svc - spark-examples job failed on single node kubernetes cluster due to java.net.UnknownHostException: kubernetes.default.svc 在 Kubernetes 集群上部署 Portainer 失败 - deploying Portainer on Kubernetes Cluster failed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM