WARN Error while fetching metadata with correlation id 5 : {testtopic=LEADER_NOT_AVAILABLE}

当生产数据的时候,报错如下:提示没有可用的kafka 主节点

root@ubuntu-130:/opt/kafka_2.11-0.11.0.2/bin# ./kafka-console-producer.sh --broker-list 192.168.13.130:9092 --topic testtopic
>hello
[2019-07-14 23:42:47,318] WARN Error while fetching metadata with correlation id 1 : {testtopic=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
[2019-07-14 23:42:47,512] WARN Error while fetching metadata with correlation id 3 : {testtopic=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
[2019-07-14 23:42:47,631] WARN Error while fetching metadata with correlation id 4 : {testtopic=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
[2019-07-14 23:42:47,790] WARN Error while fetching metadata with correlation id 5 : {testtopic=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
[2019-07-14 23:42:48,228] WARN Error while fetching metadata with correlation id 6 : {testtopic=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
[2019-07-14 23:42:48,365] WARN Error while fetching metadata with correlation id 7 : {testtopic=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
[2019-07-14 23:42:48,496] WARN Error while fetching metadata with correlation id 8 : {testtopic=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
[2019-07-14 23:42:48,635] WARN Error while fetching metadata with correlation id 9 : {testtopic=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
[2019-07-14 23:42:48,777] WARN Error while fetching metadata with correlation id 10 : {testtopic=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
[2019-07-14 23:42:48,916] WARN Error while fetching metadata with correlation id 11 : {testtopic=LEADER_NOT

 

临时解决思路:

重新创建kafka节点id,重启kafka

修改server.properties文件,修改节点

root@ubuntu-130:/opt/zookeeper/zookeeper-3.4.8/bin# cd /opt/kafka_2.11-0.11.0.2/config/
root@ubuntu-130:/opt/kafka_2.11-0.11.0.2/config# vim server.properties
root@ubuntu-130:/opt/kafka_2.11-0.11.0.2/config#


# The id of the broker. This must be set to a unique integer for each broker.
broker.id=1000

并删除logs下的所有文件解决

重启后解决

./kafka-server-start.sh   ../config/server.properties

 

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值