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

xingbin picture xingbin · Nov 22, 2018 · Viewed 21.2k times · Source

I'm learning how to use kafka from this 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

Answer

xingbin picture xingbin · Nov 22, 2018

I find the answer on the official web site:

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

Now it works:

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