kafka创建消费者报错:zookeeper is not a recognized option
最近在hadoop上搭建kafka的时候,使用
bin/kafka-console-producer.sh --broker-list hadoop132:9092,hadoop133:9092,hadoop134:9092 --topic first
此命令创建kafka消息生产者,也就是hadoop132:9092、hadoop133:9092、hadoop134:9092这三个端口生产消息。
之后在hadoop132上使用
bin/kafka-console-consumer.sh --zookeeper hadoop132:2181 --from-beginning --topic first
此命令创建消费者的时候,一直报错
zookeeper is not a recognized option
意思就是bin/kafka-console-producer.sh
这个命令本身没有zookeeper
这个参数,而在下面的提示中
Option Description
------ -----------
--bootstrap-server <String: server to REQUIRED: The server(s) to connect to.
connect to>
--consumer-property <String: A mechanism to pass user-defined
consumer_prop> properties in the form key=value to
the consumer.
--consumer.config <String: config file> Consumer config properties file. Note
that [consumer-property] takes
preced