Newer versions(2.2+) of Kafka no longer requires ZooKeeper connection string
--zookeeper localhost:2181
It throws the following exception while creating a topic
Exception in thread “main” joptsimple.UnrecognizedOptionException:
zookeeper is not a recognized option
Instead, add Kafka Broker --bootstrap-server localhost:9092
connection string.
./kafka-topics.sh --create --topic test-topic --bootstrap-server localhost:9092 --replication-factor 1 --partitions 4