I am trying to create topics in Kafka by following the guide on Apache Kafka website through command line. While running the command:
bin/kafka-topics.sh --c
For those who are sure that the brokers are up and running, check your server.properties
configuration.
In my case the znodes for kafka is /kafka
as shown below.
zookeeper.connect=zk1.beta:2181,zk2.beta:2181,zk3.beta:2181/kafka
So, try the following command while creating topic:
bin/kafka-topics.sh --create --zookeeper zk1.beta:2181/kafka --replication-factor 2 --partitions 2 --topic test2
The same scenario I faced after deleting the only topic I had created.
The way to solve it was put Kafka and Zookeeper down, updated Kafka settings (server.properties file) where I add the following setting
delete.topic.enable=true
saved file, turn Zookeeper and Kafka up and everything run as usual.
Probably there is leftover, runaway zookeeper on your server from one of the previous deployments. List the pods, containers, processes, etc. and check their age/start time to spot it.
Try adding in your serverwith:
delete.topic.enable=true
If I were you I would try this code:
bin/kafka-topics.sh --create --zookeeper localhost:2181/kafka --replication-factor 1 --partitions 1 --topic test
If you are using a cluster where zookeeper be distributed in 3 nodes you should substitue localhost:2181/kafka
for direccion1:2181,direction2:2181,direction3:2181/kafka
Delete the logs and consumer offsets folder which is getting created in the below directory.
C:\Kafka\kafka_2.12-2.5.0\data\zookeeper
PS: You may loose all the previous topic details.