zookeeper is not a recognized option

zookeeper is not a recognized option

 

创建消费者时候报错:

.\bin\windows\kafka-console-consumer.bat --zookeeper localhost:2181 --topic ads_log 
zookeeper is not a recognized option

问题原因:

新版本kafka中,--zookeeper这种启动方式已删除。

解决办法:

0.90版本之后启动消费者的方法如下:

.\bin\windows\kafka-topics.bat  --bootstrap-server localhost:9092 --topic ads_log --from-beginning
 --bootstrap-server 参数

 创建主题:都可以

.\bin\windows\kafka-topics.bat --create  --bootstrap-server localhost:9092 --replication-factor 1 --partitions 3 --topic ads

.\bin\windows\kafka-topics.bat --create  --zookeeper localhost:2181 --replication-factor 1 --partitions 3 --topic ads

完结!

大多数人都以为是才智成就了科学家,他们错了,是品格。---爱因斯坦
原文地址:https://www.cnblogs.com/wqbin/p/15759286.html