How to recover Kafka from complete zookeeper loss and new start?

Viewed 3953

I have a simple Kafka cluster of 3 brokers and 3 zk nodes.

If I wipe out 2/3 zk nodes and bring them back (even new "clean" ones), everything recovers as zk re-syncs.

If I wipe out all 3 zk nodes and restart them "clean" (think docker containers or AWS auto-scaling group instances), the brokers are confused. All of the data structures in zk (basic paths, brokers, topics, etc.) are gone, since I have a blank zk.

How can I recover from this scenario? I am (potentially) willing to live with lost topics (since we automate topic creation), but the brokers (unlike with startup) do not "know" that zk is blank and so do not reinitialize (set up structures, register brokers, etc.). Conversely, I could back up zk and restore it, as long as I know what to backup/restore.

The key element is fully automated, though. In cloud-native, I cannot rely on a human doing the restore or checking.

1 Answers
Related