報錯
ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
kafka.common.InconsistentClusterIdException: The Cluster ID lWXm_NMhTdyWWb0VhVJqLw doesn’t match stored clusterId Some(5_QiXBs-SESQnOPIRAd9EA) 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)
在啟動bin/kafka-server-start.sh時報錯,錯誤原因跟server.properties中的檔案有關。
參考文章:kafka僞叢集搭建常見錯誤
将log.dir對應的存儲檔案夾删除後,建立新的檔案夾。然後重新開機Kafka,執行成功!