broker集群每台主机上都没有显示错误信息,但是kafka之类的工具启动的话会报错,提示“1 partitions have leader brokers without a matching listener”,在这之前我滚动升级过kafka集群。
WARN 1 [ XNIO-1 task-5] k.c.NetworkClient$DefaultMetadataUpdater : [Consumer clientId=kafdrop-consumer, groupId=null] 1 partitions have leader brokers without a matching listener, including [IIoT-0]
./kafka-topics.sh --zookeeper localhost:2181 --describe --topic IIoT
Topic: IIoT PartitionCount: 3 ReplicationFactor: 1 Configs:
Topic: IIoT Partition: 0 Leader: none Replicas: 3 Isr: 3
Topic: IIoT Partition: 1 Leader: 1 Replicas: 1 Isr: 1
Topic: IIoT Partition: 2 Leader: 2 Replicas: 2 Isr: 2
./kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list 192.168.10.145:9092 --topic IIoT
Error: partition 0 does not have a leader. Skip getting offsets
[2020-11-19 08:50:35,271] WARN [Consumer clientId=GetOffsetShell, groupId=null] 1 partitions have leader brokers without a matching listener, including [IIoT-0] (org.apache.kafka.clients.NetworkClient)
IIoT:1:20213
IIoT:2:11589
我已经设置了auto.leader.rebalance.enable=true
,感觉是不是数据丢了?
这种只有一个分区没有leader的情况,修复的方法 也是重新选举分区leader吗?