我正在尝试启动Kafka消费者,但它显示如下错误:
$ bin/kafka-console-consumer.sh --zookeeper localhost:2181 —topic Hello-Kafka
Exactly one of whitelist/blacklist/topic is required.
Option Description
------ -----------
--blacklist <blacklist> Blacklist of topics to exclude from
consumption.
--bootstrap-server <server to connect
to>
--consumer.config <config file> Consumer config properties file.
--csv-reporter-enabled If set, the CSV metrics reporter will
be enabled
--delete-consumer-offsets If specified, the consumer path in
zookeeper is deleted when starting up
............
............
答案 0 :(得分:3)
您可以按照以下方式使用
bin / kafka-console-consumer.sh --bootstrap-server localhost:9092 - from-beginning --topic Hello-Kafka
答案 1 :(得分:2)
添加--whitelist Hello-Kafka
帮助了我。
答案 2 :(得分:0)
bin / kafka-console-consumer.sh --zookeeper localhost:2181 --bootstrap-server localhost:9092 --topic test --from-beginning
答案 3 :(得分:0)
bin / kafka-console-consumer.sh --zookeeper localhost:2181 -topic Hello-Kafka - from-beginning --whitelist Hello-Kafka
答案 4 :(得分:0)
对于kafka_2.11-2.1.0以上的kafka版本:./kafka-console-consumer.sh --bootstrap-server IP:PORT --from-beginning --topic主题
对于Kafka版本kafka_2.11_0.9.0.0及以下版本:/kafka-console-consumer.sh --zookeeper IP:PORT —主题主题-从头开始--whitelist主题