kafka2.8出现NotLeaderOrFollowerException
具体错误信息:
org.apache.kafka.common.errors.NotLeaderOrFollowerException: For requests intended only for the leader, this error indicates that the broker is not the current leader. For requests intended for any replica, this error indicates that the broker is not a replica of the topic partition.
5个集群的kafka,由于其中两个不知道什么原因挂掉了,导致数据无法同步,主题isr同步信息如下:
需要填入完整的kafka集群地址
kafka-topics.sh --bootstrap-server 192.168.10.2:9200,192.168.10.3:9200,192.168.10.4:9200,192.168.10.5:9200,192.168.10.6:9200 --describe --topic a
Topic: a Partition: 0 Leader: 4 Replicas: 1,4 Isr: 4
Topic: a Partition: 1 Leader: 2 Replicas: 4,2 Isr: 2
Topic: a Partition: 2 Leader: 2 Replicas: 2,3 Isr: 3,2
Topic: a Partition: 3 Leader: 3 Replicas: 3,5 Isr: 3
Topic: a Partition: 4 Leader: 5 Replicas: 5,1 Isr: 5,1
Topic: a Partition: 5 Leader: 2 Replicas: 1,2 Isr: 2
Topic: a Partition: 6 Leader: 4 Replicas: 4,3 Isr: 3,4
Topic: a Partition: 7 Leader: 2 Replicas: 2,5 Isr: 2
Topic: a Partition: 8 Leader: 3 Replicas: 3,1 Isr: 1,3
Topic: a Partition: 9 Leader: 4 Replicas: 5,4 Isr: 4
解决办法:
删除主题,自动重新创建后正常
需要填入完整的kafka集群地址
kafka-topics.sh --bootstrap-server 192.168.10.2:9200,192.168.10.3:9200,192.168.10.4:9200,192.168.10.5:9200,192.168.10.6:9200 --delete --topic a

浙公网安备 33010602011771号