Search code examples
javaapache-kafkaapache-zookeeper

zookeeper is not a recognized option when executing kafka-console-consumer.sh


I'm learning how to use Kafka on this website link(except I'm using port 2182 in zookeeper), but it shows:

zookeeper is not a recognized option

after executing:

sudo ./bin/kafka-console-consumer.sh --topic test --zookeeper localhost:2182

How to fix it?

Env:

kafka_2.11-2.1.0
zookeeper-3.4.10

Solution

  • I find the answer on the QUICKSTART:

    Option zookeeper is deprecated, use --bootstrap-server instead.

    Now it works:

    bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning