ARTICLE DETAIL

资讯详情

深耕网站建设与运营推广的一线实战洞察。

kafka2.8出现NotLeaderOrFollowerException

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-topics.sh --bootstrap-server 地址:端口,逗号分隔 --describe --topic flighttask_progress_data
        Topic: a Partition: 0    Leader: 4       Replicas: 1,4   Isr: 4Topic: a Partition: 1    Leader: 2       Replicas: 4,2   Isr: 2Topic: a Partition: 2    Leader: 2       Replicas: 2,3   Isr: 3,2Topic: a Partition: 3    Leader: 3       Replicas: 3,5   Isr: 3Topic: a Partition: 4    Leader: 5       Replicas: 5,1   Isr: 5,1Topic: a Partition: 5    Leader: 2       Replicas: 1,2   Isr: 2Topic: a Partition: 6    Leader: 4       Replicas: 4,3   Isr: 3,4Topic: a Partition: 7    Leader: 2       Replicas: 2,5   Isr: 2Topic: a Partition: 8    Leader: 3       Replicas: 3,1   Isr: 1,3Topic: a Partition: 9    Leader: 4       Replicas: 5,4   Isr: 4

解决办法:
删除主题,自动重新创建后正常

kafka-topics.sh --bootstrap-server 地址:端口,逗号分隔 --delete --topic flighttask_progress_data
返回列表