Kafka deletes zk metadata by mistake, delete all (test environment only)

  • background:

    When testing kafaka connect, each time to clean up dirty data, delete the topic directly, and then enter zk to delete the corresponding topic, accidentally delete all the data in zk at a time, resulting in kafka not starting.


  1. Under the guidance of the kafka god, I chose the simplest and most violent method: clean up all the data of zk and kafka, and then restart, the specific steps are as follows: 1. First, stop the zk and kafka processes respectively;
  2. Delete all the data in the dataDir and dataLogDir configured in the zk configuration file zoo.cfg except the myid file, then restart zk, and then enter the zk client to execute:
rmr /admin/delete_topics
rmr /config
rmr /brokers/topics
rmr /consumers
rmr /schema_registry
  1. Clear all the files under log.dirs in the configuration file server.properties in kafka, and then restart kafka to succeed.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324933702&siteId=291194637