org.I0Itec.zkclient.exception.ZkTimeoutException

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

Stop all kafka and zookeper proccesses ("ps -aux | grep zoo" and "ps -aux | grep kafka" and kill all the proccess ids) then, run zookeper and then run kafka server.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • GitHub comment 73#182111514
    via GitHub by gigafone
    ,
  • Server disconnects from the zookeeper with the following log. It appears that it can't determine the realm even though the setup I performed looks ok. In here find the list of principals, logs and Jaas file: 1) Jaas file KafkaServer { com.sun.security.auth.module.Krb5LoginModule required useKeyTab=true storeKey=true keyTab="/mnt/kafka/kafka/kafka.keytab" principal="kafka/10.24.251.175@EXAMPLE.COM"; }; Client { com.sun.security.auth.module.Krb5LoginModule required useKeyTab=true storeKey=true keyTab="/mnt/kafka/kafka/kafka.keytab" principal="kafka/10.24.251.175@EXAMPLE.COM"; }; 2) Principles from krb admin kadmin.local: list_principals K/M@EXAMPLE.COM kadmin/admin@EXAMPLE.COM kadmin/changepw@EXAMPLE.COM kadmin/ip-10-24-251-175.us-west-2.compute.internal@EXAMPLE.COM kafka/10.24.251.175@EXAMPLE.COM krbtgt/EXAMPLE.COM@EXAMPLE.COM 3) [2016-01-12 14:53:13,132] WARN SASL configuration failed: javax.security.auth.login.LoginException: Cannot locate default realm Will continue connection to Zookeeper server without SASL authentication, if Zookeeper server allows it. (org.apache.zookeeper.ClientCnxn) [2016-01-12 14:53:13,134] INFO Opening socket connection to server localhost/127.0.0.1:2181 (org.apache.zookeeper.ClientCnxn) [2016-01-12 14:53:13,134] INFO zookeeper state changed (AuthFailed) (org.I0Itec.zkclient.ZkClient) [2016-01-12 14:53:13,139] INFO Accepted socket connection from /127.0.0.1:53028 (org.apache.zookeeper.server.NIOServerCnxnFactory) [2016-01-12 14:53:13,139] INFO Socket connection established to localhost/127.0.0.1:2181, initiating session (org.apache.zookeeper.ClientCnxn) [2016-01-12 14:53:13,142] INFO Client attempting to establish new session at /127.0.0.1:53028 (org.apache.zookeeper.server.ZooKeeperServer) [2016-01-12 14:53:13,144] INFO Established session 0x152376012690001 with negotiated timeout 6000 for client /127.0.0.1:53028 (org.apache.zookeeper.server.ZooKeeperServer) [2016-01-12 14:53:13,146] INFO Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x152376012690001, negotiated timeout = 6000 (org.apache.zookeeper.ClientCnxn) [2016-01-12 14:53:13,146] INFO zookeeper state changed (SyncConnected) (org.I0Itec.zkclient.ZkClient) [2016-01-12 14:53:19,087] INFO Terminate ZkClient event thread. (org.I0Itec.zkclient.ZkEventThread) [2016-01-12 14:53:19,088] INFO Processed session termination for sessionid: 0x152376012690001 (org.apache.zookeeper.server.PrepRequestProcessor) [2016-01-12 14:53:19,089] INFO Session: 0x152376012690001 closed (org.apache.zookeeper.ZooKeeper) [2016-01-12 14:53:19,089] INFO EventThread shut down (org.apache.zookeeper.ClientCnxn) [2016-01-12 14:53:19,089] INFO Closed socket connection for client /127.0.0.1:53028 which had sessionid 0x152376012690001 (org.apache.zookeeper.server.NIOServerCnxn) [2016-01-12 14:53:19,090] FATAL Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer) org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 6000 at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:1223) at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:155) at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:129) at kafka.utils.ZkUtils$.createZkClientAndConnection(ZkUtils.scala:89) at kafka.utils.ZkUtils$.apply(ZkUtils.scala:71) at kafka.server.KafkaServer.initZk(KafkaServer.scala:278) at kafka.server.KafkaServer.startup(KafkaServer.scala:168) at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:37) at kafka.Kafka$.main(Kafka.scala:67) at kafka.Kafka.main(Kafka.scala)
    via by Mohit Anchlia,
  • Networking/Port issue with ZooKeeper
    via Ask Ubuntu by srn
    ,
  • Server disconnects from the zookeeper with the following log. It appears that it can't determine the realm even though the setup I performed looks ok. In here find the list of principals, logs and Jaas file: 1) Jaas file KafkaServer { com.sun.security.auth.module.Krb5LoginModule required useKeyTab=true storeKey=true keyTab="/mnt/kafka/kafka/kafka.keytab" principal="kafka/10.24.251.175@EXAMPLE.COM"; }; Client { com.sun.security.auth.module.Krb5LoginModule required useKeyTab=true storeKey=true keyTab="/mnt/kafka/kafka/kafka.keytab" principal="kafka/10.24.251.175@EXAMPLE.COM"; }; 2) Principles from krb admin kadmin.local: list_principals K/M@EXAMPLE.COM kadmin/admin@EXAMPLE.COM kadmin/changepw@EXAMPLE.COM kadmin/ip-10-24-251-175.us-west-2.compute.internal@EXAMPLE.COM kafka/10.24.251.175@EXAMPLE.COM krbtgt/EXAMPLE.COM@EXAMPLE.COM 3) [2016-01-12 14:53:13,132] WARN SASL configuration failed: javax.security.auth.login.LoginException: Cannot locate default realm Will continue connection to Zookeeper server without SASL authentication, if Zookeeper server allows it. (org.apache.zookeeper.ClientCnxn) [2016-01-12 14:53:13,134] INFO Opening socket connection to server localhost/127.0.0.1:2181 (org.apache.zookeeper.ClientCnxn) [2016-01-12 14:53:13,134] INFO zookeeper state changed (AuthFailed) (org.I0Itec.zkclient.ZkClient) [2016-01-12 14:53:13,139] INFO Accepted socket connection from /127.0.0.1:53028 (org.apache.zookeeper.server.NIOServerCnxnFactory) [2016-01-12 14:53:13,139] INFO Socket connection established to localhost/127.0.0.1:2181, initiating session (org.apache.zookeeper.ClientCnxn) [2016-01-12 14:53:13,142] INFO Client attempting to establish new session at /127.0.0.1:53028 (org.apache.zookeeper.server.ZooKeeperServer) [2016-01-12 14:53:13,144] INFO Established session 0x152376012690001 with negotiated timeout 6000 for client /127.0.0.1:53028 (org.apache.zookeeper.server.ZooKeeperServer) [2016-01-12 14:53:13,146] INFO Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x152376012690001, negotiated timeout = 6000 (org.apache.zookeeper.ClientCnxn) [2016-01-12 14:53:13,146] INFO zookeeper state changed (SyncConnected) (org.I0Itec.zkclient.ZkClient) [2016-01-12 14:53:19,087] INFO Terminate ZkClient event thread. (org.I0Itec.zkclient.ZkEventThread) [2016-01-12 14:53:19,088] INFO Processed session termination for sessionid: 0x152376012690001 (org.apache.zookeeper.server.PrepRequestProcessor) [2016-01-12 14:53:19,089] INFO Session: 0x152376012690001 closed (org.apache.zookeeper.ZooKeeper) [2016-01-12 14:53:19,089] INFO EventThread shut down (org.apache.zookeeper.ClientCnxn) [2016-01-12 14:53:19,089] INFO Closed socket connection for client /127.0.0.1:53028 which had sessionid 0x152376012690001 (org.apache.zookeeper.server.NIOServerCnxn) [2016-01-12 14:53:19,090] FATAL Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer) org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 6000 at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:1223) at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:155) at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:129) at kafka.utils.ZkUtils$.createZkClientAndConnection(ZkUtils.scala:89) at kafka.utils.ZkUtils$.apply(ZkUtils.scala:71) at kafka.server.KafkaServer.initZk(KafkaServer.scala:278) at kafka.server.KafkaServer.startup(KafkaServer.scala:168) at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:37) at kafka.Kafka$.main(Kafka.scala:67) at kafka.Kafka.main(Kafka.scala)
    via by Mohit Anchlia,
  • Cannot connect to remote zookeeper
    via Stack Overflow by srn
    ,
  • Not able to run Kafka server
    via Stack Overflow by Ishan mahajan
    ,
    • org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 6000 at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:1223) at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:155) at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:129) at kafka.utils.ZkUtils$.createZkClientAndConnection(ZkUtils.scala:89) at kafka.utils.ZkUtils$.apply(ZkUtils.scala:71) at kafka.server.KafkaServer.initZk(KafkaServer.scala:278) at kafka.server.KafkaServer.startup(KafkaServer.scala:168) at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:37) at kafka.Kafka$.main(Kafka.scala:67) at kafka.Kafka.main(Kafka.scala)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    19 more bugmates