Good day! I set the priority of loading services on one of the servers. All services start correctly, with the exception of the kafka, which starts last. I drop the log of the kafka after starting the server.

(kafka.server.KafkaConfig) [2016-11-10 13:15:58,150] INFO starting (kafka.server.KafkaServer) [2016-11-10 13:15:58,157] INFO Connecting to zookeeper on k3-one:2181 (kafka.server.KafkaServer) [2016-11-10 13:16:04,593] 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:1232) at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:156) at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:130) at kafka.utils.ZkUtils$.createZkClientAndConnection(ZkUtils.scala:75) at kafka.utils.ZkUtils$.apply(ZkUtils.scala:57) at kafka.server.KafkaServer.initZk(KafkaServer.scala:294) at kafka.server.KafkaServer.startup(KafkaServer.scala:180) at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:37) at kafka.Kafka$.main(Kafka.scala:67) at kafka.Kafka.main(Kafka.scala) [2016-11-10 13:16:04,595] INFO shutting down (kafka.server.KafkaServer) [2016-11-10 13:16:04,599] INFO shut down completed (kafka.server.KafkaServer) [2016-11-10 13:16:04,600] FATAL Fatal error during KafkaServerStartable startup. Prepare to shutdown (kafka.server.KafkaServerStartable) org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 6000 at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:1232) at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:156) at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:130) at kafka.utils.ZkUtils$.createZkClientAndConnection(ZkUtils.scala:75) at kafka.utils.ZkUtils$.apply(ZkUtils.scala:57) at kafka.server.KafkaServer.initZk(KafkaServer.scala:294) at kafka.server.KafkaServer.startup(KafkaServer.scala:180) at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:37) at kafka.Kafka$.main(Kafka.scala:67) at kafka.Kafka.main(Kafka.scala) [2016-11-10 13:16:04,601] INFO shutting down (kafka.server.KafkaServer) 

So, if I manually stop the service and start it, the launch takes place without any problems. Please tell me, what could be the joint? Thanks in advance for taking time to my question!

  • Your kafka does not see zookeeper on k3-one: 2181. Probably by this time the network interface has not started yet. It is necessary either to set the dependence on the network, or to increase the timeout. - bigov
  • What then would you recommend doing? - Alexander Sergeev
  • Specify the version of your server and how to start services. - bigov
  • Ubuntu 16.04.1 LTS init.d services start automatically, in this order: postgresql> redis> zookeeper> cassandra> glassfish> kafka (host1) | postgresql> rabbitmq> redis> apache-storm> glassfish (host2) - Alexander Sergeev
  • show kofig kafka in ini.d - bigov

1 answer 1

I think, adding the third line to the init script of the Kafka will help you:

 ### BEGIN INIT INFO # Provides: kafka # Required-Start: $network $syslog $named .... 
  • Thank you! Also changed the priority. Put on the 9th stream. Everything is great, thanks again! - Alexander Sergeev