今天kafka启动报错:
kafka.common.InconsistentClusterIdException: The Cluster ID Lnh8cPXGQsm0svgyhLcJtQ doesn't match stored clusterId Some(sqVS5qbvRZuFAwJYTzr7kA) in meta.properties. The broker is trying to join the wrong cluster. Configured zookeeper.connect may be wrong.
at kafka.server.KafkaServer.startup(KafkaServer.scala:220)
at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:44)
at kafka.Kafka$.main(Kafka.scala:84)
at kafka.Kafka.main(Kafka.scala)
意思是集群id跟元数据meta.properties中存储的不一致,导致启动失败。
因此去查看meta.properties文件中的元数据信息。这个文件的存储路径是通过/config/server.properties配置文件中的log.dirs属性配置的。所以通过配置文件找到meta.properties,修改里面的cluster.id即可。
建议删除 kafka-logs
去这里查看kafka-logs放在那里
# A comma separated list of directories under which to store log files
log.dirs=/tmp/kafka-logs
删除log.dirs
下所有文件