报错背景:
CDH中安装完成kafka的组件后不能成功启动,发现UI界面中的broker.id和服务器中的broker.id不一致,
因此更改了服务器中broker.id
但是更改完成之后还是报错。
报错现象:
Fatal error during KafkaServer startup. Prepare to shutdown kafka.common.InconsistentBrokerIdException: Configured broker.id 68 doesn't match stored broker.id 113 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.getBrokerIdAndOfflineDirs(KafkaServer.scala:624) at kafka.server.KafkaServer.startup(KafkaServer.scala:201) at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:43) at kafka.Kafka$.main(Kafka.scala:92) at com.cloudera.kafka.wrap.Kafka$.main(Kafka.scala:76) at com.cloudera.kafka.wrap.Kafka.main(Kafka.scala)
报错原因:
配置文件server.properties中的id与 meta.properties中的id不一致导致报错。
报错解决:
修改两个配置文件id一致。
meta.properties 所在路径:/var/local/kafka/data
server.properties 所在路径:/opt/cloudera/parcels/KAFKA-3.1.1-1.3.1.1.p0.2/etc/kafka/conf.dist/
问题解决