Kafka啓動異常之InconsistentClusterIdException

一.場景
kafka集羣一般都是部署在zookeeper集羣之上的,當Kafka出現異常時,強行關閉kafka集羣或zookeeper集羣時,重新啓動時經常會出現異常InconsistentClusterIdException。
二.異常信息

ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
kafka.common.InconsistentClusterIdException: The Cluster ID F-bhGf-3T1qgjuQ0c1wCRw doesn't match stored clusterId Some(FO2XIwDrSSiJSeWo4B80hQ) 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:223)
	at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:44)
	at kafka.Kafka$.main(Kafka.scala:82)
	at kafka.Kafka.main(Kafka.scala)

三.原因分析及解決方案
kafka配置日誌路徑,用來保存執行過程中的各種信息,當kafka異常關閉時,日誌記錄就會出現異常,會把當時的情況記錄到meta.properties文件中,重新啓動時此文件會對啓動造成影響,kafka重啓報錯的原因就在這裏。
解決方案

  1. 清空日誌目錄【日誌不重要或可以容忍日誌丟失】。
  2. 調整日誌目錄【需要修改配置】。
  3. 刪除日誌目錄下的meta.properties文件。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章