kafka报错(一):Configured broker.id 0 doesn't match stored broker.id 1 in meta.properties

我们在配置kafka时可能会修改brokerid,这个时候启动可能会遇到报错
报错详细信息:

[2018-09-03 07:51:10,759] ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
kafka.common.InconsistentBrokerIdException: Configured broker.id 0 doesn't match stored broker.id 1 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:681)
        at kafka.server.KafkaServer.startup(KafkaServer.scala:209)
        at io.confluent.support.metrics.SupportedServerStartable.startup(SupportedServerStartable.java:117)
        at io.confluent.support.metrics.SupportedKafka.main(SupportedKafka.java:66)
[2018-09-03 07:51:10,762] INFO shutting down (kafka.server.KafkaServer)
[2018-09-03 07:51:10,766] WARN  (kafka.utils.CoreUtils$)
java.lang.NullPointerException
        at kafka.server.KafkaServer$$anonfun$shutdown$5.apply$mcV$sp(KafkaServer.scala:579)
        at kafka.utils.CoreUtils$.swallow(CoreUtils.scala:86)
        at kafka.server.KafkaServer.shutdown(KafkaServer.scala:579)
        at kafka.server.KafkaServer.startup(KafkaServer.scala:329)
        at io.confluent.support.metrics.SupportedServerStartable.startup(SupportedServerStartable.java:117)
        at io.confluent.support.metrics.SupportedKafka.main(SupportedKafka.java:66)
[2018-09-03 07:51:10,771] INFO [ZooKeeperClient] Closing. (kafka.zookeeper.ZooKeeperClient)
[2018-09-03 07:51:10,774] INFO EventThread shut down for session: 0x3000004909a008e (org.apache.zookeeper.ClientCnxn)
[2018-09-03 07:51:10,774] INFO Session: 0x3000004909a008e closed (org.apache.zookeeper.ZooKeeper)
[2018-09-03 07:51:10,775] INFO [ZooKeeperClient] Closed. (kafka.zookeeper.ZooKeeperClient)
[2018-09-03 07:51:10,777] INFO shut down completed (kafka.server.KafkaServer)
[2018-09-03 07:51:10,779] INFO shutting down (kafka.server.KafkaServer)

从报错中可以看出是配置文件server.properties中的id与 meta.properties中的id不一致导致的。修改两个配置文件id一致就好了。meta.properties的路径在log.dirs下。

更多:kafka深入理解专栏
——————————————————————————————————
作者:桃花惜春风
转载请标明出处,原文地址:
https://blog.csdn.net/xiaoyu_BD/article/details/82351461
如果感觉本文对您有帮助,您的支持是我坚持写作最大的动力,谢谢!

你可能感兴趣的:(kafka)