kafka流处理抛错Error while fetching metadata with correlation id 2 : {apache-out=LEADER_NOT}

/atmd/kafka/bin//kafka-console-consumer.sh --bootstrap-server PLAINTEXT://10.66.0.31:9092 --topic apache-out

Error while fetching metadata with correlation id 2 : {apache-out=LEADER_NOT}

开始按照网上的一些方法,修改kafka/config/server.xml:

打开注释#advertised.listeners=PLAINTEXT://your.host.name:9092

然后分别改了几个kafka的这个配置项并重启kafka,但后来发现还是会有这个错误,触发时机都是写了个新的topic,所以后来怀疑是否只要在执行producer.sh时新写一个topic会自动创建主题,而在consumer里使用一个新的topic就会报错上面的信息

未验证,已经ok了(按照上面的想法再试ok)

附上几个常用的命令:

[lsx@stg-hdp01 lsx]$ head -n 1 /home/lsx/logfile/tango-access.log | sed "s/ *$/ XM/" | /atmd/kafka/bin/kafka-console-producer.sh --broker-list stg-hdp01:9092,stg-hdp02:9092  --sync   --topic apache-out8

>>[lsx@stg-hdp01 lsx]/atmd/kafka/bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list  stg-hdp01:9092 --topic apache-out2apache-out2:2:0
apache-out2:5:0
apache-out2:4:0
apache-out2:7:0
apache-out2:1:0
apache-out2:3:0
apache-out2:6:0
apache-out2:0:1

[lsx@stg-hdp01 kafka]$ /atmd/kafka/bin//kafka-console-consumer.sh --bootstrap-server PLAINTEXT://stg-hdp01:9092 --topic apache-out8 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值