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!