Linnux下kafka报错zookeeper is not a recognized option

Linnux下kafka报错zookeeper is not a recognized option

我们在消费kafka的时候可能会报如下的错误:
12057079-a15afffa1c272cc0.png
image.png
启动kafka的命令如下:
/usr/local/kafka/bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
当我在消费端使用如下的命令的时候会报错:
/usr/local/kafka/bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-begining
查阅资料后发现是kafka的版本问题,低版本的kafka可以使用以上的命令,但是在高版本的kafka中需要使用如下命令才行:
/usr/local/kafka/bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning

猜你喜欢

转载自blog.csdn.net/weixin_34275734/article/details/87538782