我正在尝试确定某个主题的当前偏移量,我运行
bin/kafka-run-class.sh kafka.tools.GetOffsetShell
命令,出现以下错误,可能是什么情况,以及如何解决此问题?
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
答案 0 :(得分:1)
您的卡夫卡经纪人很可能倒闭了。
您可以运行
kafka-topics --zookeeper host:2181 --describe --topic topic_name
,然后查看Leader是否等于-1。在这种情况下,您需要启动Kafka经纪人。
bin/kafka-server-start.sh config/server.properties