why when deleting one topic in Kafka by this command :
/opt/kafka/confluent-4.0.0/bin/kafka-topics --zookeeper 109.169.xxx.xx:2181 --delete --topic test
and again see the list of Topics again, This message appears?
test - marked for deletion
why when deleting one topic in Kafka by this command :
/opt/kafka/confluent-4.0.0/bin/kafka-topics --zookeeper 109.169.xxx.xx:2181 --delete --topic test
and again see the list of Topics again, This message appears?
test - marked for deletion
In Kafka, topic deletion is asynchronous. When you run the kafka-topics
tool with --delete
, you are simply marking the topic for deletion.
The actual deletion happens in most cases shortly after but depending on the state of your cluster it can be delayed.
In case it gets stuck, bouncing the controller usually helps.
If after a long time your topic is not deleted then make sure that delete.topic.enable
in server.properties
is set to true
(although confluent 4.0.0 comes with this configuration). If you still face the same issue you can manually delete the topic by logging into Zookeeper using
zookeeper-shell localhost:2181
Now you can remove the topic using
rmr /brokers/topics/{topic_name}
rmr /admin/delete_topics/{topic_name}
Note that you might need to delete topic folder from Kafka broker machine before logging into ZK in order to manually remove the topic.