全网最详细的启动Kafka服务时出现kafka.common.InconsistentBrokerIdException: Configured brokerId 3 doesn't matc

Posted zlslch

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了全网最详细的启动Kafka服务时出现kafka.common.InconsistentBrokerIdException: Configured brokerId 3 doesn't matc相关的知识,希望对你有一定的参考价值。

 

 

  不多说,直接上干货!

 

 

 

 问题详情

    执行bin/kafka-server-start.sh config/server.properties 时,

技术分享图片

[[email protected] kafka_2.11-0.9.0.0]$ bin/kafka-server-start.sh config/server.properties 
[2018-06-17 16:05:38,983] INFO KafkaConfig values: 
    request.timeout.ms = 30000
    log.roll.hours = 168
    inter.broker.protocol.version = 0.9.0.X

 

 

 

 

 

技术分享图片

[2018-06-17 16:05:39,269] INFO Socket connection established to bigdata-pro01.kfk.com/192.168.80.151:2181, initiating session (org.apache.zookeeper.ClientCnxn)
[2018-06-17 16:05:39,280] INFO Session establishment complete on server bigdata-pro01.kfk.com/192.168.80.151:2181, sessionid = 0x1640c718dfa0016, negotiated timeout = 6000 (org.apache.zookeeper.ClientCnxn)
[2018-06-17 16:05:39,282] INFO zookeeper state changed (SyncConnected) (org.I0Itec.zkclient.ZkClient)
[2018-06-17 16:05:39,345] INFO Loading logs. (kafka.log.LogManager)
[2018-06-17 16:05:39,351] INFO Logs loading complete. (kafka.log.LogManager)
[2018-06-17 16:05:39,352] INFO Starting log cleanup with a period of 300000 ms. (kafka.log.LogManager)
[2018-06-17 16:05:39,354] INFO Starting log flusher with a default period of 9223372036854775807 ms. (kafka.log.LogManager)
[2018-06-17 16:05:39,365] FATAL Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
kafka.common.InconsistentBrokerIdException: Configured brokerId 3 doesnt match stored brokerId 1 in meta.properties
    at kafka.server.KafkaServer.getBrokerId(KafkaServer.scala:630)
    at kafka.server.KafkaServer.startup(KafkaServer.scala:175)
    at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:37)
    at kafka.Kafka$.main(Kafka.scala:67)
    at kafka.Kafka.main(Kafka.scala)
[2018-06-17 16:05:39,370] INFO shutting down (kafka.server.KafkaServer)
[2018-06-17 16:05:39,381] INFO Shutting down. (kafka.log.LogManager)
[2018-06-17 16:05:39,391] INFO Shutdown complete. (kafka.log.LogManager)
[2018-06-17 16:05:39,392] INFO Terminate ZkClient event thread. (org.I0Itec.zkclient.ZkEventThread)
[2018-06-17 16:05:39,398] INFO EventThread shut down (org.apache.zookeeper.ClientCnxn)
[2018-06-17 16:05:39,398] INFO Session: 0x1640c718dfa0016 closed (org.apache.zookeeper.ZooKeeper)
[2018-06-17 16:05:39,401] INFO shut down completed (kafka.server.KafkaServer)
[2018-06-17 16:05:39,402] FATAL Fatal error during KafkaServerStartable startup. Prepare to shutdown (kafka.server.KafkaServerStartable)
kafka.common.InconsistentBrokerIdException: Configured brokerId 3 doesnt match stored brokerId 1 in meta.properties
    at kafka.server.KafkaServer.getBrokerId(KafkaServer.scala:630)
    at kafka.server.KafkaServer.startup(KafkaServer.scala:175)
    at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:37)
    at kafka.Kafka$.main(Kafka.scala:67)
    at kafka.Kafka.main(Kafka.scala)
[2018-06-17 16:05:39,403] INFO shutting down (kafka.server.KafkaServer)

 

 

 

 

 

 

  问题分析

    一般都是,你自己修改了kafka版本之间切换造成的。你之前,是用kafka0.8.X系列,现在你升级使用0.9.X。没有完全更改过来。

 

 

 

 

 

    解决办法:

  找到配置文件

  cat server.properties

 

  查看log.dirs所在位置

  log.dirs=/opt/modules/kafka_2.11-0.9.0.0/kafka-logs

 

  按着这个路径找到

  meta.properties

  修改brokerid

技术分享图片

[[email protected] kafka-logs]$ cat meta.properties 
#
#Sun Jun 17 15:59:31 CST 2018
version=0
broker.id=1
[[email protected]-pro03 kafka-logs]$ pwd
/opt/modules/kafka_2.11-0.9.0.0/kafka-logs
[[email protected]-pro03 kafka-logs]$ vim meta.properties 

 

 

 

 

 

 

 

 

技术分享图片

 

[[email protected] kafka-logs]$ cat meta.properties 
#
#Sun Jun 17 15:59:31 CST 2018
version=0
broker.id=3
[[email protected]-pro03 kafka-logs]$ pwd
/opt/modules/kafka_2.11-0.9.0.0/kafka-logs
[[email protected]-pro03 kafka-logs]$ 

 

 

 

 

 

 

 

 

技术分享图片

[email protected] (org.apache.zookeeper.ZooKeeper)
[2018-06-17 16:12:47,785] INFO Opening socket connection to server bigdata-pro03.kfk.com/192.168.80.153:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
[2018-06-17 16:12:47,785] INFO Waiting for keeper state SyncConnected (org.I0Itec.zkclient.ZkClient)
[2018-06-17 16:12:47,790] INFO Socket connection established to bigdata-pro03.kfk.com/192.168.80.153:2181, initiating session (org.apache.zookeeper.ClientCnxn)
[2018-06-17 16:12:47,798] INFO Session establishment complete on server bigdata-pro03.kfk.com/192.168.80.153:2181, sessionid = 0x3640c720971000f, negotiated timeout = 6000 (org.apache.zookeeper.ClientCnxn)
[2018-06-17 16:12:47,801] INFO zookeeper state changed (SyncConnected) (org.I0Itec.zkclient.ZkClient)
[2018-06-17 16:12:47,851] INFO Loading logs. (kafka.log.LogManager)
[2018-06-17 16:12:47,858] INFO Logs loading complete. (kafka.log.LogManager)
[2018-06-17 16:12:47,858] INFO Starting log cleanup with a period of 300000 ms. (kafka.log.LogManager)
[2018-06-17 16:12:47,860] INFO Starting log flusher with a default period of 9223372036854775807 ms. (kafka.log.LogManager)
[2018-06-17 16:12:47,917] INFO Awaiting socket connections on bigdata-pro03.kfk.com:9092. (kafka.network.Acceptor)
[2018-06-17 16:12:47,919] INFO [Socket Server on Broker 3], Started 1 acceptor threads (kafka.network.SocketServer)
[2018-06-17 16:12:47,940] INFO [ExpirationReaper-3], Starting  (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
[2018-06-17 16:12:47,944] INFO [ExpirationReaper-3], Starting  (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
[2018-06-17 16:12:48,010] INFO Creating /controller (is it secure? false) (kafka.utils.ZKCheckedEphemeral)
[2018-06-17 16:12:48,020] INFO Result of znode creation is: OK (kafka.utils.ZKCheckedEphemeral)
[2018-06-17 16:12:48,020] INFO 3 successfully elected as leader (kafka.server.ZookeeperLeaderElector)
[2018-06-17 16:12:48,104] INFO [GroupCoordinator 3]: Starting up. (kafka.coordinator.GroupCoordinator)
[2018-06-17 16:12:48,115] INFO [ExpirationReaper-3], Starting  (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
[2018-06-17 16:12:48,116] INFO [GroupCoordinator 3]: Startup complete. (kafka.coordinator.GroupCoordinator)
[2018-06-17 16:12:48,119] INFO [ExpirationReaper-3], Starting  (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
[2018-06-17 16:12:48,141] INFO [Group Metadata Manager on Broker 3]: Removed 0 expired offsets in 35 milliseconds. (kafka.coordinator.GroupMetadataManager)
[2018-06-17 16:12:48,194] INFO [ThrottledRequestReaper-Produce], Starting  (kafka.server.ClientQuotaManager$ThrottledRequestReaper)
[2018-06-17 16:12:48,200] INFO [ThrottledRequestReaper-Fetch], Starting  (kafka.server.ClientQuotaManager$ThrottledRequestReaper)
[2018-06-17 16:12:48,249] INFO Will not load MX4J, mx4j-tools.jar is not in the classpath (kafka.utils.Mx4jLoader$)
[2018-06-17 16:12:48,267] INFO Creating /brokers/ids/3 (is it secure? false) (kafka.utils.ZKCheckedEphemeral)
[2018-06-17 16:12:48,275] INFO Result of znode creation is: OK (kafka.utils.ZKCheckedEphemeral)
[2018-06-17 16:12:48,276] INFO Registered broker 3 at path /brokers/ids/3 with addresses: PLAINTEXT -> EndPoint(bigdata-pro03.kfk.com,9092,PLAINTEXT) (kafka.utils.ZkUtils)
[2018-06-17 16:12:48,316] INFO Kafka version : 0.9.0.0 (org.apache.kafka.common.utils.AppInfoParser)
[2018-06-17 16:12:48,316] INFO Kafka commitId : fc7243c2af4b2b4a (org.apache.kafka.common.utils.AppInfoParser)
[2018-06-17 16:12:48,321] INFO [Kafka Server 3], started (kafka.server.KafkaServer)
[2018-06-17 16:12:48,335] INFO New leader is 3 (kafka.server.ZookeeperLeaderElector$LeaderChangeListener)

 

 

 

 

 

 

 

 

 

 

欢迎大家,加入我的微信公众号:大数据躺过的坑        人工智能躺过的坑
 
 
 

同时,大家可以关注我的个人博客

   http://www.cnblogs.com/zlslch/   和     http://www.cnblogs.com/lchzls/      http://www.cnblogs.com/sunnyDream/   

   详情请见:http://www.cnblogs.com/zlslch/p/7473861.html

 

  人生苦短,我愿分享。本公众号将秉持活到老学到老学习无休止的交流分享开源精神,汇聚于互联网和个人学习工作的精华干货知识,一切来于互联网,反馈回互联网。
  目前研究领域:大数据、机器学习、深度学习、人工智能、数据挖掘、数据分析。 语言涉及:Java、Scala、Python、Shell、Linux等 。同时还涉及平常所使用的手机、电脑和互联网上的使用技巧、问题和实用软件。 只要你一直关注和呆在群里,每天必须有收获

 

      对应本平台的讨论和答疑QQ群:大数据和人工智能躺过的坑(总群)(161156071)技术分享图片技术分享图片技术分享图片技术分享图片技术分享图片 

 

技术分享图片

 

 

 

 

 

技术分享图片

 

 

 

 

 

 技术分享图片

 

以上是关于全网最详细的启动Kafka服务时出现kafka.common.InconsistentBrokerIdException: Configured brokerId 3 doesn't matc的主要内容,如果未能解决你的问题,请参考以下文章

全网最详细的跑python2.7时出现from mysql import connector ImportError: No module named mysql的问题解决办法(图文详解)

kafka部署时出现的天坑

kafka部署时出现的天坑

Kafka-Connect:启动 S3 Sink 连接器时出现无法识别的错误

2021年大数据Kafka:❤️Kafka的集群搭建以及shell启动命令脚本编写❤️

2021年大数据Kafka:❤️Kafka的集群搭建以及shell启动命令脚本编写❤️