本文介绍了错误:分区 0 没有领导者.跳过获取偏移量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试确定某个主题的当前偏移量,我运行了
I am trying to determine the current offset on a topic, I run the
bin/kafka-run-class.sh kafka.tools.GetOffsetShell
Command 和我收到以下错误,可能发生了什么,我该如何解决?
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
推荐答案
很可能您的 Kafka 代理宕机了.
Most probably your Kafka brokers are down.
你可以运行
kafka-topics --zookeeper host:2181 --describe --topic topic_name
并查看Leader是否等于-1.如果是这种情况,那么您需要启动 Kafka 代理.
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
这篇关于错误:分区 0 没有领导者.跳过获取偏移量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!