kafka.common.InconsistentClusterIdException: The Cluster ID doesn‘t match stored clusterId Some()
Posted 雅冰石
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了kafka.common.InconsistentClusterIdException: The Cluster ID doesn‘t match stored clusterId Some()相关的知识,希望对你有一定的参考价值。
一 问题描述
kafka启动失败,报错:
[2021-05-10 11:22:43,263] ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
kafka.common.InconsistentClusterIdException: The Cluster ID VLPFfY-WQkWmK7X9_C1aHQ doesn't match stored clusterId Some(0TVA9OzOTzCGMTqY50sBKA) 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)
二 出错原因
我刚迁移zookeeper dataDir目录了。
三 解决办法
cd /tmp/kafka-logs #kafka的Log.dirs路径
cp meta.properties meta.properties_bak
修改 meta.properties中的cluster.id值,示例:
我这里将0TVA9OzOTzCGMTqY50sBKA改成了VLPFfY-WQkWmK7X9_C1aHQ
四 总结
迁移zookeeper目录的话,也要修改meta.properties中的cluster.id值
以上是关于kafka.common.InconsistentClusterIdException: The Cluster ID doesn‘t match stored clusterId Some()的主要内容,如果未能解决你的问题,请参考以下文章