异常信息
[2021-05-03 19:14:28,840] INFO Updated cache from existing <empty> to latest FinalizedFeaturesAndEpoch(features=Features{}, epoch=0). (kafka.server.FinalizedFeatureCache)
[2021-05-03 19:14:28,855] INFO Cluster ID = I9TxciNjQiKV48quVZP2yw (kafka.server.KafkaServer)
[2021-05-03 19:14:28,927] ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
kafka.common.InconsistentClusterIdException: The Cluster ID I9TxciNjQiKV48quVZP2yw doesn't match stored clusterId Some(1aJOmeJITIygVlghQGApxA) 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:218)
at kafka.Kafka$.main(Kafka.scala:109)
at kafka.Kafka.main(Kafka.scala)
[2021-05-03 19:14:28,985] INFO shutting down (kafka.server.KafkaServer)
[2021-05-03 19:14:28,990] INFO [feature-zk-node-event-process-thread]: Shutting down (kafka.server.FinalizedFeatureChangeListener$ChangeNotificationProcessorThread)
解决方案
1、删除kafka 日志目录下meta.properties文件
2、修改kafka 配置文件中 server.properties 日志目录
3、问题分析
当kafka异常关闭时,日志记录就会出现异常,会把当时的情况记录到meta.properties文件中,重新启动时此文件会对启动造成影响。