kafka使用者命令行工具未按预期工作

holgip5t  于 2021-06-04  发布在  Kafka
关注(0)|答案(1)|浏览(609)

我正在使用kafka命令行工具来使用kafka主题中的数据,但这并不像预期的那样工作。我正在使用以下命令:

kafka-console-consumer.sh --bootstrap-server totkafka-console-consumer.sh --bootstrap-server localhost1:9092,localhost2:9092, localhost3:9092 --topic topic-name

我得到以下错误堆栈:

Exception in thread "main" joptsimple.MultipleArgumentsForOptionException: Found multiple arguments for option bootstrap-server, but you asked for only one
    at joptsimple.OptionSet.valueOf(OptionSet.java:179)
    at kafka.tools.ConsoleConsumer$ConsumerConfig.<init>(ConsoleConsumer.scala:301)
    at kafka.tools.ConsoleConsumer$.main(ConsoleConsumer.scala:52)
    at kafka.tools.ConsoleConsumer.main(ConsoleConsumer.scala)

你能帮我做这个吗?
致以最诚挚的问候

irlmq6kh

irlmq6kh1#

在命令中,请尝试以下操作:

kafka-console-consumer.sh --bootstrap-server localhost1:9092,localhost2:9092,localhost3:9092 --topic topic-name

相关问题