Kafka-启动时报错: ERROR Fatal error during KafkaServer startup. Prepare to shutdown
一、问题描述
在启动kafka时报错:
ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
kafka.common.InconsistentBrokerIdException: Configured broker.id 1 doesn’t match stored broker.id Some(0) in meta.properties. If you moved your data, make sure your configured broker.id matches. If you intend to create a new broker, you should remove all data in your data directories (log.dirs).
at kafka.server.KafkaServer.getOrGenerateBrokerId(KafkaServer.scala:793)
at kafka.server.KafkaServer.startup(KafkaServer.scala:221)
at kafka.Kafka$.main(Kafka.scala:109)
at kafka.Kafka.main(Kafka.scala)
二、问题原因
起因是这样的:由于在一个节点上启动运行了kafka后,再拷贝到其他节点上,配置kafka相关配置,在启动kafka时报错。
究其原因,是meta.properties(路径:/opt/kafka/logs)里面的id值和/opt/kafka/config的server.properties中的broker.id不一致。
三、解决办法
找到了原因,把broker=0和broker.id=1修改为一样的值,然后重启动,ERROR Fatal error during KafkaServer startup. Prepare to shutdown 的错误就没了。
本文来自博客园,作者:业余砖家,转载请注明原文链接:https://www.cnblogs.com/yeyuzhuanjia/p/17684283.html