Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After Linux restart, Kafka throwing "no brokers found when trying to rebalance"

I followed an excellent step-by-step tutorial for installing Kafka on Linux. Everything was working fine for me until I restarted Linux. After the restart, I get the following error when I try to consume a queue with kafka-console-consumer.sh.

$ ~/kafka/bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic TutorialTopic --from-beginning

[2016-02-04 03:16:54,944] WARN [console-consumer-6966_bob-kafka-storm-1454577414492-8728ae43], no brokers found when trying to rebalance. (kafka.consumer.ZookeeperConsumerConnector)

Before I ran the kafka-console-consumer.sh script, I did push data to the Kafka queue using the kafka-console-producer.sh script. These steps worked without issue before restarting Linux.

I can fix the error by manually starting Kafka; but, I would rather that Kafka start automatically.

What might cause Kafka to not start correctly after restart?

like image 347
Bob Cardenas Avatar asked Oct 31 '22 10:10

Bob Cardenas


1 Answers

So I had a similar issue in our hortonworks cluster earlier today. It seems like zookeeper was not starting correctly. I first tried kakfa-console-producer and got the exception below:

kafka-console-producer.sh --broker-list=localhost:9093 --topic=some_topic < /tmp/sometextfile.txt```

kafka.common.KafkaException: fetching topic metadata for topics```

The solution for me was to restart the server that had stopped responding. yours may be different but play around with console producer and see what errors your getting.

like image 113
ben jarman Avatar answered Nov 02 '22 11:11

ben jarman