Unable to start kafka with zookeeper (kafka.common.InconsistentClusterIdException)

Solution 1:

I solved this issue on my machine (Windows 10) by deleting the meta.properties file found in the log directory.

The issue itself occured after I had stopped both the zookeeper and server and then restarted them.

Solution 2:

Usually, this problem arises when kafka logs are stored in the persistent folder and zookeeper data in the temporary, or vice-versa. Then, after system restart, files that are stored in the temporary directory get cleaned and regenerated leading to the configuration mismatch.

To prevent this situation to happen again revise log.dirs kafka parameter in the server.properties and dataDir zookeeper parameter in zookeeper.properties and ensure that both point to the same type of directory (e.g. temporary or persistent). Only after that reset inconsistent data (if any) using for example method from Jacob's answer, i.e. remove meta.properties file, and restart zookeeper and kafka.

Solution 3:

I encountered the same issue while running Kafka server on my Windows Machine. You can try the following to resolve this issue:

  1. Open server server.properties file which is located in your kafka folder kafka_2.11-2.4.0\config (considering your version of kafka, folder name could be kafka_<kafka_version>)
  2. Search for entry log.dirs
  3. If your log.dir path contains windows directory path like this E:\Shyam\Software\kafka_2.11-2.4.0\kafka-logs which has a single backslash i.e , change it to double back-slash i.e with \

Solution 4:

Try the following...

  1. Enable following line in ./config/server.properties

    listeners=PLAINTEXT://:9092

  2. Modify default ZooKeeper dataDir

  3. Modify default Kafka log dir