启动kafka时报错(部分信息):
[2022-05-12 20:26:05,589] INFO Cluster ID = Zc7nlyfTQ5qPbhY2d8I_3A (kafka.server.KafkaServer) [2022-05-12 20:26:05,598] ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer) kafka.common.InconsistentClusterIdException: The Cluster ID Zc7nlyfTQ5qPbhY2d8I_3A doesn't match stored clusterId Some(ZvQZIX9gTB-dj05be_i_-w) 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:228) at kafka.Kafka$.main(Kafka.scala:109) at kafka.Kafka.main(Kafka.scala) [2022-05-12 20:26:05,600] INFO shutting down (kafka.server.KafkaServer)
原因:配置文件server.properties中的Cluster id与 meta.properties中的Cluster id不一致
解决方法:复制报错信息上的Cluster ID,即 Cluster ID = Zc7nlyfTQ5qPbhY2d8I_3A
到配置文件中设置的 log.dirs目录下,修改 meta.properties 里面的 cluster.id 为报错里的id,重新启动kafka。