kafka.zookeeper.ZooKeeperClientTimeoutException:处于等待状态的连接处于超时状态:CONNECTING

时间:2020-09-17 08:06:01

标签: apache-kafka

我正在尝试在Ubuntu中安装kafka。我已经下载了kafka tar.gz文件,并将其解压缩。启动了zookeeper服务器。尝试启动kafka服务器时,收到了超时异常。

能不能让我知道分辨率。

以下是服务器日志:

kafka-server-start.sh ../config/server.properties
[2020-09-17 15:53:02,990] INFO Registered kafka:type=kafka.Log4jController MBean (kafka.utils.Log4jControllerRegistration$)
[2020-09-17 15:53:03,310] INFO Setting -D jdk.tls.rejectClientInitiatedRenegotiation=true to disable client-initiated TLS renegotiation (org.apache.zookeeper.common.X509Util)
[2020-09-17 15:53:03,347] INFO Registered signal handlers for TERM, INT, HUP (org.apache.kafka.common.utils.LoggingSignalHandler)
[2020-09-17 15:53:03,351] INFO starting (kafka.server.KafkaServer)
[2020-09-17 15:53:03,352] INFO Connecting to zookeeper on localhost:2181 (kafka.server.KafkaServer)
[2020-09-17 15:53:03,368] INFO [ZooKeeperClient Kafka server] Initializing a new session to localhost:2181. (kafka.zookeeper.ZooKeeperClient)
[2020-09-17 15:53:03,373] INFO Client environment:zookeeper.version=3.5.8-f439ca583e70862c3068a1f2a7d4d068eec33315, built on 05/04/2020 15:53 GMT (org.apache.zookeeper.ZooKeeper)
[2020-09-17 15:53:03,373] INFO Client environment:host.name=LAPTOP-D6RGQ60T.localdomain (org.apache.zookeeper.ZooKeeper)
[2020-09-17 15:53:03,373] INFO Client environment:java.version=1.8.0_261 (org.apache.zookeeper.ZooKeeper)
[2020-09-17 15:53:03,373] INFO Client environment:java.vendor=Oracle Corporation (org.apache.zookeeper.ZooKeeper)
[2020-09-17 15:53:03,373] INFO Client environment:java.home=/opt/jdk/jre1.8.0_261 (org.apache.zookeeper.ZooKeeper)
[2020-09-17 15:53:03,373] INFO Client environment:java.class.path=/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/activation-1.1.1.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/aopalliance-repackaged-2.5.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/argparse4j-0.7.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/audience-annotations-0.5.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/commons-cli-1.4.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/commons-lang3-3.8.1.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/connect-api-2.6.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/connect-basic-auth-extension-2.6.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/connect-file-2.6.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/connect-json-2.6.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/connect-mirror-2.6.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/connect-mirror-client-2.6.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/connect-runtime-2.6.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/connect-transforms-2.6.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/hk2-api-2.5.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/hk2-locator-2.5.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/hk2-utils-2.5.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jackson-annotations-2.10.2.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jackson-core-2.10.2.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jackson-databind-2.10.2.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jackson-dataformat-csv-2.10.2.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jackson-datatype-jdk8-2.10.2.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jackson-jaxrs-base-2.10.2.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jackson-jaxrs-json-provider-2.10.2.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jackson-module-jaxb-annotations-2.10.2.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jackson-module-paranamer-2.10.2.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jackson-module-scala_2.12-2.10.2.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jakarta.activation-api-1.2.1.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jakarta.annotation-api-1.3.4.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jakarta.inject-2.5.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jakarta.ws.rs-api-2.1.5.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jakarta.xml.bind-api-2.3.2.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/javassist-3.22.0-CR2.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/javassist-3.26.0-GA.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/javax.servlet-api-3.1.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/javax.ws.rs-api-2.1.1.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jaxb-api-2.3.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jersey-client-2.28.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jersey-common-2.28.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jersey-container-servlet-2.28.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jersey-container-servlet-core-2.28.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jersey-hk2-2.28.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jersey-media-jaxb-2.28.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jersey-server-2.28.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jetty-client-9.4.24.v20191120.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jetty-continuation-9.4.24.v20191120.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jetty-http-9.4.24.v20191120.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jetty-io-9.4.24.v20191120.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jetty-security-9.4.24.v20191120.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jetty-server-9.4.24.v20191120.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jetty-servlet-9.4.24.v20191120.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jetty-servlets-9.4.24.v20191120.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jetty-util-9.4.24.v20191120.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/jopt-simple-5.0.4.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/kafka-clients-2.6.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/kafka-log4j-appender-2.6.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/kafka-streams-2.6.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/kafka-streams-examples-2.6.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/kafka-streams-scala_2.12-2.6.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/kafka-streams-test-utils-2.6.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/kafka-tools-2.6.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/kafka_2.12-2.6.0-sources.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/kafka_2.12-2.6.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/log4j-1.2.17.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/lz4-java-1.7.1.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/maven-artifact-3.6.3.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/metrics-core-2.2.0.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/netty-buffer-4.1.50.Final.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/netty-codec-4.1.50.Final.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/netty-common-4.1.50.Final.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/netty-handler-4.1.50.Final.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/netty-resolver-4.1.50.Final.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/netty-transport-4.1.50.Final.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/netty-transport-native-epoll-4.1.50.Final.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/netty-transport-native-unix-common-4.1.50.Final.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/osgi-resource-locator-1.0.1.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/paranamer-2.8.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/plexus-utils-3.2.1.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/reflections-0.9.12.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/rocksdbjni-5.18.4.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/scala-collection-compat_2.12-2.1.6.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/scala-java8-compat_2.12-0.9.1.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/scala-library-2.12.11.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/scala-logging_2.12-3.9.2.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/scala-reflect-2.12.11.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/slf4j-api-1.7.30.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/slf4j-log4j12-1.7.30.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/snappy-java-1.1.7.3.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/validation-api-2.0.1.Final.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/zookeeper-3.5.8.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/zookeeper-jute-3.5.8.jar:/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin/../libs/zstd-jni-1.4.4-7.jar (org.apache.zookeeper.ZooKeeper)
[2020-09-17 15:53:03,374] INFO Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib (org.apache.zookeeper.ZooKeeper)
[2020-09-17 15:53:03,374] INFO Client environment:java.io.tmpdir=/tmp (org.apache.zookeeper.ZooKeeper)
[2020-09-17 15:53:03,374] INFO Client environment:java.compiler=<NA> (org.apache.zookeeper.ZooKeeper)
[2020-09-17 15:53:03,374] INFO Client environment:os.name=Linux (org.apache.zookeeper.ZooKeeper)
[2020-09-17 15:53:03,374] INFO Client environment:os.arch=amd64 (org.apache.zookeeper.ZooKeeper)
[2020-09-17 15:53:03,374] INFO Client environment:os.version=4.4.0-18362-Microsoft (org.apache.zookeeper.ZooKeeper)
[2020-09-17 15:53:03,374] INFO Client environment:user.name=sreekanth (org.apache.zookeeper.ZooKeeper)
[2020-09-17 15:53:03,374] INFO Client environment:user.home=/home/sreekanth (org.apache.zookeeper.ZooKeeper)
[2020-09-17 15:53:03,374] INFO Client environment:user.dir=/home/sreekanth/Downloads/kafka_2.12-2.6.0/bin (org.apache.zookeeper.ZooKeeper)
[2020-09-17 15:53:03,374] INFO Client environment:os.memory.free=976MB (org.apache.zookeeper.ZooKeeper)
[2020-09-17 15:53:03,374] INFO Client environment:os.memory.max=1024MB (org.apache.zookeeper.ZooKeeper)
[2020-09-17 15:53:03,374] INFO Client environment:os.memory.total=1024MB (org.apache.zookeeper.ZooKeeper)
[2020-09-17 15:53:03,376] INFO Initiating client connection, connectString=localhost:2181 sessionTimeout=18000 watcher=kafka.zookeeper.ZooKeeperClient$ZooKeeperClientWatcher$@47af7f3d (org.apache.zookeeper.ZooKeeper)
[2020-09-17 15:53:03,380] INFO jute.maxbuffer value is 4194304 Bytes (org.apache.zookeeper.ClientCnxnSocket)
[2020-09-17 15:53:03,384] INFO zookeeper.request.timeout value is 0. feature enabled= (org.apache.zookeeper.ClientCnxn)
[2020-09-17 15:53:03,386] INFO [ZooKeeperClient Kafka server] Waiting until connected. (kafka.zookeeper.ZooKeeperClient)
[2020-09-17 15:53:03,389] INFO Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
[2020-09-17 15:53:03,392] INFO Socket connection established, initiating session, client: /127.0.0.1:50975, server: localhost/127.0.0.1:2181 (org.apache.zookeeper.ClientCnxn)
[2020-09-17 15:53:21,394] WARN Client session timed out, have not heard from server in 18001ms for sessionid 0x0 (org.apache.zookeeper.ClientCnxn)
[2020-09-17 15:53:21,394] INFO Client session timed out, have not heard from server in 18001ms for sessionid 0x0, closing socket connection and attempting reconnect (org.apache.zookeeper.ClientCnxn)
[2020-09-17 15:53:23,114] INFO Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
[2020-09-17 15:53:23,115] INFO Socket connection established, initiating session, client: /127.0.0.1:50976, server: localhost/127.0.0.1:2181 (org.apache.zookeeper.ClientCnxn)
[2020-09-17 15:53:41,117] WARN Client session timed out, have not heard from server in 18001ms for sessionid 0x0 (org.apache.zookeeper.ClientCnxn)
[2020-09-17 15:53:41,117] INFO Client session timed out, have not heard from server in 18001ms for sessionid 0x0, closing socket connection and attempting reconnect (org.apache.zookeeper.ClientCnxn)
[2020-09-17 15:53:42,712] INFO Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
[2020-09-17 15:53:42,713] INFO Socket connection established, initiating session, client: /127.0.0.1:50977, server: localhost/127.0.0.1:2181 (org.apache.zookeeper.ClientCnxn)
[2020-09-17 15:54:00,714] WARN Client session timed out, have not heard from server in 18001ms for sessionid 0x0 (org.apache.zookeeper.ClientCnxn)
[2020-09-17 15:54:00,715] INFO Client session timed out, have not heard from server in 18001ms for sessionid 0x0, closing socket connection and attempting reconnect (org.apache.zookeeper.ClientCnxn)
[2020-09-17 15:54:02,432] INFO Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
[2020-09-17 15:54:02,433] INFO Socket connection established, initiating session, client: /127.0.0.1:50980, server: localhost/127.0.0.1:2181 (org.apache.zookeeper.ClientCnxn)
[2020-09-17 15:54:03,388] INFO [ZooKeeperClient Kafka server] Closing. (kafka.zookeeper.ZooKeeperClient)
[2020-09-17 15:54:20,433] WARN Client session timed out, have not heard from server in 18000ms for sessionid 0x0 (org.apache.zookeeper.ClientCnxn)
[2020-09-17 15:54:20,555] INFO Session: 0x0 closed (org.apache.zookeeper.ZooKeeper)
[2020-09-17 15:54:20,556] INFO EventThread shut down for session: 0x0 (org.apache.zookeeper.ClientCnxn)
[2020-09-17 15:54:20,557] INFO [ZooKeeperClient Kafka server] Closed. (kafka.zookeeper.ZooKeeperClient)
[2020-09-17 15:54:20,559] ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
kafka.zookeeper.ZooKeeperClientTimeoutException: Timed out waiting for connection while in state: CONNECTING
        at kafka.zookeeper.ZooKeeperClient.$anonfun$waitUntilConnected$3(ZooKeeperClient.scala:262)
        at kafka.zookeeper.ZooKeeperClient.waitUntilConnected(ZooKeeperClient.scala:258)
        at kafka.zookeeper.ZooKeeperClient.<init>(ZooKeeperClient.scala:119)
        at kafka.zk.KafkaZkClient$.apply(KafkaZkClient.scala:1865)
        at kafka.server.KafkaServer.createZkClient$1(KafkaServer.scala:419)
        at kafka.server.KafkaServer.initZkClient(KafkaServer.scala:444)
        at kafka.server.KafkaServer.startup(KafkaServer.scala:222)
        at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:44)
        at kafka.Kafka$.main(Kafka.scala:82)
        at kafka.Kafka.main(Kafka.scala)
[2020-09-17 15:54:20,561] INFO shutting down (kafka.server.KafkaServer)
[2020-09-17 15:54:20,565] INFO shut down completed (kafka.server.KafkaServer)
[2020-09-17 15:54:20,566] ERROR Exiting Kafka. (kafka.server.KafkaServerStartable)
[2020-09-17 15:54:20,567] INFO shutting down (kafka.server.KafkaServer)

1 个答案:

答案 0 :(得分:1)

许多Zookeeper实例运行得较早。我杀死了所有的动物园管理员和经纪人,重新重新启动了他们。现在工作正常。