![在这里插入图片描述](https://img-blog.csdnimg.cn/2020062922204628.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzIxMzgzNDM1,size_16,color_FFFFFF,t_70)
1.背景
执行kafka控制台消费数据报错
> ./kafka-console-consumer.sh --zookeeper 1.zookeeper:2181 --topic test --from-beginning
No brokers found in ZK.
是localhost 上没有运行 zookeeper,或者 2181端口是错误的。
./kafka-topics.sh --zookeeper 1.zookeeper1:2181 --list
能不能列出所有的topic,如果能,列出来的topic里有没有你写的test。
我猜测,参数 --zookeeper localhost:2181
可能有问题,要么localhost上没有kafka,要么 2181
端口错。
还要么你的域名写错了,我的 1.zookeeper1
写成了 1.zookeeper
2.再现
本次也是写错误了