错误:分区x没有引导符。跳过偏移量-但描述表明领导者存在

时间:2019-05-08 16:28:59

标签: apache-kafka

错误:分区0没有引导符。跳过获取偏移量-但描述表明领导者存在

Error: partition 0 does not have a leader. Skip getting offsets一样,我遇到了同样的问题,但是--describe说领导者在场,请问您有解决方案吗?谢谢

Kafka经纪人状态更改日志显示:

[timestamp] ERROR [Controller id=**** epoch=**] Controller **** epoch ** failed to change state for partition ********* from OfflinePartition to OnlinePartition (state.change.logger)
kafka.common.StateChangeFailedException: Failed to elect leader for partition ********** under strategy OfflinePartitionLeaderElectionStrategy

再次感谢,代理总数为4分区数为3,复制因子为4。

请注意,消费者并未在Zookeeper上写入偏移量

./kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list broker1:6667,broker2:6667 --topic topic1 --time -1

Error: partition 2 does not have a leader. Skip getting offsets 
Error: partition 1 does not have a leader. Skip getting offsets 
Error: partition 0 does not have a leader. Skip getting offsets

./kafka-topics.sh --describe --zookeeper zookeepernode01:2181 --topic topic1 

Topic: topic1 PartitionCount:3 ReplicationFactor:4 Configs: Topic: topic1

Partition: 0 Leader: 2 Replicas: 2,4,6,7 Isr: 2,4,6 Topic: topic1 
Partition: 1 Leader: 3 Replicas: 3,6,7,8 Isr: 3,7,8 Topic: topic1 
Partition: 2 Leader: 4 Replicas: 4,7,8,1001 Isr: 4,7 Topic: topic1

1 个答案:

答案 0 :(得分:0)

已解决,问题在于基础架构从4个代理更改为3个,主题相同。因此,有些主题的领导者不存在,因此也无法删除,因此删除是通过Zookeeper cli force移除进行的:

How to Delete a topic in apache kafka