解决Kafka异常Error while fetching metadata

kafka | 2020-03-06 16:25:47

我按照帖子 kafka如何删除topic,先删除topic,再新建topic,发送消息就不断报错:

 

[2019-09-18 12:25:00,511] WARN Error while fetching metadata with correlation id 30 : {designTopic=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
[2019-09-18 12:25:00,620] WARN Error while fetching metadata with correlation id 31 : {designTopic=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
[2019-09-18 12:25:00,726] WARN Error while fetching metadata with correlation id 32 : {designTopic=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
[2019-09-18 12:25:00,835] WARN Error while fetching metadata with correlation id 33 : {designTopic=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
[2019-09-18 12:25:00,940] WARN Error while fetching metadata with correlation id 34 : {designTopic=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
[2019-09-18 12:25:01,049] WARN Error while fetching metadata with correlation id 36 : {designTopic=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
[2019-09-18 12:25:01,157] WARN Error while fetching metadata with correlation id 37 : {designTopic=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
[2019-09-18 12:25:01,265] WARN Error while fetching metadata with correlation id 38 : {designTopic=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
[2019-09-18 12:25:01,371] WARN Error while fetching metadata with correlation id 39 : {designTopic=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
[2019-09-18 12:25:01,477] WARN Error while fetching metadata with correlation id 40 : {designTopic=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
[2019-09-18 12:25:01,584] WARN Error while fetching metadata with correlation id 41 : {designTopic=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
[2019-09-18 12:25:01,692] WARN Error while fetching metadata with correlation id 42 : {designTopic=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)

 

解决方法:

重启kafka和zookeeper topic就恢复正常了

 

登录后即可回复 登录 | 注册
    
关注编程学问公众号