kafka,创建消费者时提示no brokers found in zk.
详见:
hadoop@master:/usr/local/kafka/bin> ./kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning
No brokers found in ZK.
上面写错了。
是localhost 上没有运行 zookeeper,或者 2181端口是错误的。
检查一下
./kafka-topics.sh --zookeeper localhost:2181 --list 能不能列出所有的topic,如果能,列出来的topic里有没有你写的test。
我猜测,参数 --zookeeper localhost:2181 可能有问题,要么localhost上没有kafka,要么 2181 端口错。