I am trying to setup kafka for messaging service.
I am using kafka_2.9.2-0.8.1.1 version, I have started zookeeper, kafka and created a topic with no partition and replication factor.
Once I start my consumer, I get the following error
./kafka-console-consumer.sh --zookeeper localhost:9092 --topic test --from-beginning
Exception in thread "main" org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 6000
at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:880)
at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:98)
at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:84)
at kafka.consumer.ZookeeperConsumerConnector.connectZk(ZookeeperConsumerConnector.scala:156)
at kafka.consumer.ZookeeperConsumerConnector.<init>(ZookeeperConsumerConnector.scala:114)
at kafka.consumer.ZookeeperConsumerConnector.<init>(ZookeeperConsumerConnector.scala:128)
at kafka.consumer.Consumer$.create(ConsumerConnector.scala:89)
at kafka.consumer.console Consumer$.main(ConsoleConsumer.scala:178)
at kafka.consumer.ConsoleConsumer.main(ConsoleConsumer.scala)
My zookeeper is running, I have ensured that by netstat command!!
Not sure what is going wrong here. Any inputs on this will be helpful
echo srvr |nc localhost 9092
, check the output. – sel-fishlsof -i -n -P | grep 2181
to get the process id and thenkill -9 process_id
– Giorgos Myrianthous