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

 

完结!

 

 

 

 

posted @ 2022-01-03 12:43  wqbin  阅读(2784)  评论(0编辑  收藏  举报