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 

猜你喜欢

转载自blog.csdn.net/lsx6766/article/details/88350440
今日推荐