Error: partition 0 does not have a leader. Skip ge

2019-08-15 22:04发布

I am trying to determine the current offset on a topic, I run the

bin/kafka-run-class.sh kafka.tools.GetOffsetShell

Command and I get the following error, What may be going on, and how do I fix this?

Picked up _JAVA_OPTIONS: -Xmx4g
Error: partition 2 does not have a leader. Skip getting offsets
Error: partition 4 does not have a leader. Skip getting offsets
Error: partition 1 does not have a leader. Skip getting offsets
Error: partition 3 does not have a leader. Skip getting offsets
Error: partition 0 does not have a leader. Skip getting offsets

1条回答
Fickle 薄情
2楼-- · 2019-08-15 22:31

Most probably your Kafka brokers are down.

You can run

kafka-topics --zookeeper host:2181 --describe --topic topic_name

and see whether the Leader is equal to -1. If this is the case then you need to start Kafka brokers.

bin/kafka-server-start.sh config/server.properties
查看更多
登录 后发表回答