zookeeper is not a recognized option zookeeper参数不支持

时间:2022-07-23
本文章向大家介绍zookeeper is not a recognized option zookeeper参数不支持,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

原因: – zookeeper is not a recognized option主要原因是 Kafka 版本过高,命令不存在,高版本不再支持此消费命令 新的消费命令如下:

./bin/kafka-console-consumer.sh --bootstrap-server xxx.xxx.xxx.xxx:9092 --topic wordsendertest --from-beginning

kafka报错内容:

WARN [Consumer clientId=consumer-1, groupId=console-consumer-950] Connection to node -1 could not be established. Broker may not be available.

这是因为你的配置文件中的PLAINTEXT跟你请求的内容不同。举例来说,我在配置文件里配置的listeners=PLAINTEXT://10.127.96.151:9092,但是我想测试的时候请求的是./kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic topic1 --from-beginning

正确的应该是./kafka-console-consumer.sh --bootstrap-server 10.127.96.151:9092 --topic topic1 --from-beginning