Thought Vector Blog

Undeleting Kafka Topics

Posted May 19, 2016

Accidentally deleted a topic, but hadn’t set delete.topic.enable in your server.properties file, and need to undo the topic deletion? Just delete the topic deletion in Zookeeper!

Just ssh into your Zookeeper machine, and start up its CLI with $ZOOKEEPER_HOME/zkCli.sh. Topics marked for deletion are stored in /admin/delete_topics/$YOUR_TOPIC_NAME, so to “undelete” it, run delete /admin/delete_topics/$YOUR_TOPIC_NAME. And there you go, your topic is saved!

Kafka version of 0.8.2 - your mileage may vary for higher versions!


READ THIS NEXT:

Simple, Clean Python Deploys with Anaconda

Deploying Python projects can be a pain - especially with Python 3.5. Anaconda is the emerging replacement for pip/virtualenv deploys, with its scope expanding past Python packages to binaries like...


author Stuart AxelbrookeBy Stuart Axelbrooke, who does data science and text analytics. You should follow him on Twitter