You have to get a consistent zookeeper cluster before adding your Kafka nodes - they will "mirror" the state in zookeeper.
So restore all the files before starting anything. Then start zookeepers and wait for for it to stabilize. Finally start Kafka nodes. - ( with the data in place of course.) Den ons 22 maj 2019 kl 10:08 skrev Srinivas, Kaushik (Nokia - IN/Bangalore) <kaushik.srini...@nokia.com>: > Hi All, > > We are trying to do a backup of kafka + zookeeper data and restore the > same back for one of our application's use case. > > We are taking below steps for the same, > 1. Take folder contents back up of data and log directories for kafka and > zookeeper. > 2. Delete the kafka zookeepers and brokers > 3. Delete the data and log files. > 4. Install kafka and zookeepers back with same broker IDs. > 5. restore the data and log files to the same directory. > // Observation here is,old topics are not listed after the broker is up > and running. > 7. Restarted kafka and zookeeper > // Observation : topics get listed but still the log files are present in > the broker log directory with empty log files. > Consumers does not work. > > We see this working in one node kafka broker cluster, but the same > scenario does not work with multi node kafka cluster. > One observation with respect to leaders of partitions is that, after > restore and restart leaders of the partitions are changed. > > Is it due to this the back up is not happening and we have to do reassign > partitions and restore the old partition assignment for a topic ?? > Is there any better or recommended way to take the back up and restore a > kafka+zookeeper cluster ?? > > Any information on this front would be very useful. > > Thanks in advance, > Kaushik. > >