I need to delete a topic in kafka-0.8.2.2.3. I have used the below command for deleting the topic -
bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic DummyTopic
bin/kafka-topics.sh --list --zookeeper localhost:2181
DummyTopic - marked for deletion
Error while executing topic command Topic "DummyTopic" already exists.
kafka.common.TopicExistsException: Topic "DummyTopic" already exists.
Deletion of a topic has been supported since 0.8.2.x version. You have to enable topic deletion (setting
delete.topic.enable to true) on all brokers first.
Follow this step by step process for manual deletion of topics
1. Stop Kafka server 2. Delete the topic directory with rm -rf command 3. Connect to Zookeeper instance 4. ls /brokers/topics 5. Remove the topic folder from ZooKeeper using rmr /brokers/topics/yourtopic 6. Restart Kafka server 7. Confirm if it was deleted or not by using this command kafka-topics.sh --list --zookeeper yourip:port