Kafka Docker Delete Topic - ashwin-shetty/Documents-Wiki GitHub Wiki
- Connect to the docker kafka use kafka and zoo keeper ip
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -e HOST_IP=localhost:9092 -e ZK=localhost:2181 -i -t wurstmeister/kafka /bin/bash
- Find file and go to it's directory
cd $(find -name "kafka-topics.sh" | sed 's|/[^/]*$||')
- List of topics
kafka-topics.sh --list --zookeeper localhost:2181
- Delete the topic
kafka-topics.sh --zookeeper localhost:2181 --delete --topic <topic_name>
Note : if localhost:2181 doesn't work then use zookeeper server IP