因为启动中致命的异常而退出kafka
[2022-10-13 17:23:48,759] ERROR Exiting Kafka due to fatal exception during startup. (kafka.Kafka$)# InconsistentClusterIdException 聚类id不一致异常
聚类的id:8ytUwdxNRXqINczxiKozcA不与在meta.properties储存的聚类id相匹配,broker尝试加入错误的聚类,zookeeper连接的设置可能是错误的
kafka.common.InconsistentClusterIdException: The Cluster ID 8ytUwdxNRXqINczxiKozcA doesn't match stored clusterId Some(8ytUwdxNRXqINczxiKozcA )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:224)
at kafka.Kafka$.main(Kafka.scala:109)
at kafka.Kafka.main(Kafka.scala)
打开kafka目录下的config文件夹
查看server.properties文件
找到log文件的目录log.dirs后面的地址
打开该目录可以找到meta.properties文件
拷贝配置文件备份cp meta.properties meta.properties.bak
修改配置文件内的cluster.id的值为报错中的id
例如此处为8ytUwdxNRXqINczxiKozcA,报错部分内容如下
kafka.common.InconsistentClusterIdException: The Cluster ID 8ytUwdxNRXqINczxiKozcA