Reputation: 330
I'm learning kafka at the moment but unfortunately I'm stuck because my kafka can't start when I run the following command in cmd
kafka-server-start.bat .\config\server.properties
my zookeeper works very well here is the error
[2021-09-23 17:18:03,849] INFO Opening socket connection to server localhost/<unresolved>:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
[2021-09-23 17:18:03,850] WARN Session 0x0 for server localhost/<unresolved>:2181, unexpected error, closing socket connection and attempting reconnect (org.apache.zookeeper.ClientCnxn)
java.nio.channels.UnresolvedAddressException
at java.base/sun.nio.ch.Net.checkAddress(Net.java:149)
at java.base/sun.nio.ch.Net.checkAddress(Net.java:157)
at java.base/sun.nio.ch.SocketChannelImpl.checkRemote(SocketChannelImpl.java:816)
at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:839)
at org.apache.zookeeper.ClientCnxnSocketNIO.registerAndConnect(ClientCnxnSocketNIO.java:277)
at org.apache.zookeeper.ClientCnxnSocketNIO.connect(ClientCnxnSocketNIO.java:287)
at org.apache.zookeeper.ClientCnxn$SendThread.startConnect(ClientCnxn.java:1021)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1064)
[2021-09-23 17:18:04,318] INFO [ZooKeeperClient] Closing. (kafka.zookeeper.ZooKeeperClient)
[2021-09-23 17:18:04,956] INFO Opening socket connection to server localhost/<unresolved>:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
[2021-09-23 17:18:05,061] INFO Session: 0x0 closed (org.apache.zookeeper.ZooKeeper)
[2021-09-23 17:18:05,061] INFO EventThread shut down for session: 0x0 (org.apache.zookeeper.ClientCnxn)
[2021-09-23 17:18:05,069] INFO [ZooKeeperClient] Closed. (kafka.zookeeper.ZooKeeperClient)
[2021-09-23 17:18:05,082] 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:230)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at kafka.utils.CoreUtils$.inLock(CoreUtils.scala:251)
at kafka.zookeeper.ZooKeeperClient.waitUntilConnected(ZooKeeperClient.scala:226)
at kafka.zookeeper.ZooKeeperClient.<init>(ZooKeeperClient.scala:95)
at kafka.zk.KafkaZkClient$.apply(KafkaZkClient.scala:1581)
at kafka.server.KafkaServer.createZkClient$1(KafkaServer.scala:348)
at kafka.server.KafkaServer.initZkClient(KafkaServer.scala:372)
at kafka.server.KafkaServer.startup(KafkaServer.scala:202)
at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:38)
at kafka.Kafka$.main(Kafka.scala:75)
at kafka.Kafka.main(Kafka.scala)
[2021-09-23 17:18:05,087] INFO shutting down (kafka.server.KafkaServer)
[2021-09-23 17:18:05,097] WARN Cannot invoke "kafka.utils.KafkaScheduler.shutdown()" because the return value of "kafka.server.KafkaServer.kafkaScheduler()" is null (kafka.utils.CoreUtils$)
java.lang.NullPointerException: Cannot invoke "kafka.utils.KafkaScheduler.shutdown()" because the return value of "kafka.server.KafkaServer.kafkaScheduler()" is null
at kafka.server.KafkaServer.$anonfun$shutdown$6(KafkaServer.scala:579)
at kafka.utils.CoreUtils$.swallow(CoreUtils.scala:86)
at kafka.server.KafkaServer.shutdown(KafkaServer.scala:579)
at kafka.server.KafkaServer.startup(KafkaServer.scala:329)
at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:38)
at kafka.Kafka$.main(Kafka.scala:75)
at kafka.Kafka.main(Kafka.scala)
[2021-09-23 17:18:05,111] INFO shut down completed (kafka.server.KafkaServer)
[2021-09-23 17:18:05,112] ERROR Exiting Kafka. (kafka.server.KafkaServerStartable)
[2021-09-23 17:18:05,116] INFO shutting down (kafka.server.KafkaServer)
i use kafka 2.12-2 java 17
Upvotes: 3
Views: 1641
Reputation: 662
I had the same issue, zookeeper was running but kafka could not connect to it. After wasting several hours on trying network, dns, firewall etc, I downloaded the latest kafka and now it works!
ps: apparently the kafka version I was using was incompatible with java 17
Upvotes: 0
Reputation: 159
I had the same problem (I was using Java 17). Following the advice of @OneCricketeer I switched to java 11 and everything worked as expected.
Upvotes: 2