报错:`zookeeper is not a recognized option`和disconnected (org.apache.kafka.clients.NetworkClient)
报错zookeeper is not a recognized option[root@localhost bin]# ./kafka-console-consumer.sh --zookeeper localhost:2181 --from-beginning --topic userlogzookeeper is not a recognized optionOptionDescription
·
报错zookeeper is not a recognized option
[root@localhost bin]# ./kafka-console-consumer.sh --zookeeper localhost:2181 --from-beginning --topic userlog
zookeeper is not a recognized option
Option Description
------ -----------
原因为: 当前使用的 创建消费者命令 与 安装的kafka版本不一致,因为kafka在0.9版本之后,使用创建的kafka 消费者命令已经变了
。
应该将上面的命令变为下面的命令进行运行
--zookeeper修改为--bootstrap-server
报错[2022-01-20 20:24:10,506] WARN [Consumer clientId=consumer-console-consumer-23606-1, groupId=console-consumer-23606] Bootstrap broker localhost:2181 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient)
[root@localhost bin]# ./kafka-console-consumer.sh --bootstrap-server localhost:2181 --from-beginning --topic userlog
[2022-01-20 20:24:10,415] WARN [Consumer clientId=consumer-console-consumer-23606-1, groupId=console-consumer-23606] Bootstrap broker localhost:2181 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient)
[2022-01-20 20:24:10,506] WARN [Consumer clientId=consumer-console-consumer-23606-1, groupId=console-consumer-23606] Bootstrap broker localhost:2181 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient)
新版本不适用端口2181,而是9092
应该修改为下面的命令
[root@localhost bin]# ./kafka-console-consumer.sh --bootstrap-server localhost:9092 --from-beginning --topic userlog
更多推荐
已为社区贡献9条内容
所有评论(0)