• ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)


    1、之前搭建的kafka,过了好久,去启动kafka,发现报如下下面的错误,有错误就要解决了。

    然后参考:https://blog.csdn.net/hello_world_qwp/article/details/79419532

    原因是由于broker.id不唯一造成的。

     1 [root@slaver1 kafka_2.11-2.1.0]# bin/kafka-server-start.sh config/server.properties 
     2 [2019-04-03 23:59:17,438] INFO Registered kafka:type=kafka.Log4jController MBean (kafka.utils.Log4jControllerRegistration$)
     3 [2019-04-03 23:59:19,418] INFO starting (kafka.server.KafkaServer)
     4 [2019-04-03 23:59:19,432] INFO Connecting to zookeeper on slaver1:2181,slaver2:2181,slaver3:2181 (kafka.server.KafkaServer)
     5 [2019-04-03 23:59:19,568] INFO [ZooKeeperClient] Initializing a new session to slaver1:2181,slaver2:2181,slaver3:2181. (kafka.zookeeper.ZooKeeperClient)
     6 [2019-04-03 23:59:19,618] INFO Client environment:zookeeper.version=3.4.13-2d71af4dbe22557fda74f9a9b4309b15a7487f03, built on 06/29/2018 00:39 GMT (org.apache.zookeeper.ZooKeeper)
     7 [2019-04-03 23:59:19,618] INFO Client environment:host.name=slaver1 (org.apache.zookeeper.ZooKeeper)
     8 [2019-04-03 23:59:19,618] INFO Client environment:java.version=1.8.0_191 (org.apache.zookeeper.ZooKeeper)
     9 [2019-04-03 23:59:19,620] INFO Client environment:java.vendor=Oracle Corporation (org.apache.zookeeper.ZooKeeper)
    10 [2019-04-03 23:59:19,620] INFO Client environment:java.home=/home/hadoop/soft/jdk1.8.0_191/jre (org.apache.zookeeper.ZooKeeper)
    11 [2019-04-03 23:59:19,622] INFO Client environment:java.class.path=/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/activation-1.1.1.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/aopalliance-repackaged-2.5.0-b42.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/argparse4j-0.7.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/audience-annotations-0.5.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/commons-lang3-3.5.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/compileScala.mapping:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/compileScala.mapping.asc:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/connect-api-2.1.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/connect-basic-auth-extension-2.1.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/connect-file-2.1.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/connect-json-2.1.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/connect-runtime-2.1.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/connect-transforms-2.1.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/guava-20.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/hk2-api-2.5.0-b42.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/hk2-locator-2.5.0-b42.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/hk2-utils-2.5.0-b42.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jackson-annotations-2.9.7.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jackson-core-2.9.7.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jackson-databind-2.9.7.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jackson-jaxrs-base-2.9.7.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jackson-jaxrs-json-provider-2.9.7.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jackson-module-jaxb-annotations-2.9.7.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/javassist-3.22.0-CR2.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/javax.annotation-api-1.2.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/javax.inject-1.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/javax.inject-2.5.0-b42.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/javax.servlet-api-3.1.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/javax.ws.rs-api-2.1.1.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/javax.ws.rs-api-2.1.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jaxb-api-2.3.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jersey-client-2.27.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jersey-common-2.27.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jersey-container-servlet-2.27.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jersey-container-servlet-core-2.27.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jersey-hk2-2.27.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jersey-media-jaxb-2.27.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jersey-server-2.27.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jetty-client-9.4.12.v20180830.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jetty-continuation-9.4.12.v20180830.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jetty-http-9.4.12.v20180830.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jetty-io-9.4.12.v20180830.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jetty-security-9.4.12.v20180830.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jetty-server-9.4.12.v20180830.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jetty-servlet-9.4.12.v20180830.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jetty-servlets-9.4.12.v20180830.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jetty-util-9.4.12.v20180830.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/jopt-simple-5.0.4.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/kafka_2.11-2.1.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/kafka_2.11-2.1.0-sources.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/kafka-clients-2.1.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/kafka-log4j-appender-2.1.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/kafka-streams-2.1.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/kafka-streams-examples-2.1.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/kafka-streams-scala_2.11-2.1.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/kafka-streams-test-utils-2.1.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/kafka-tools-2.1.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/log4j-1.2.17.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/lz4-java-1.5.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/maven-artifact-3.5.4.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/metrics-core-2.2.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/osgi-resource-locator-1.0.1.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/plexus-utils-3.1.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/reflections-0.9.11.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/rocksdbjni-5.14.2.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/scala-library-2.11.12.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/scala-logging_2.11-3.9.0.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/scala-reflect-2.11.12.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/slf4j-api-1.7.25.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/slf4j-log4j12-1.7.25.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/snappy-java-1.1.7.2.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/validation-api-1.1.0.Final.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/zkclient-0.10.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/zookeeper-3.4.13.jar:/home/hadoop/soft/kafka_2.11-2.1.0/bin/../libs/zstd-jni-1.3.5-4.jar (org.apache.zookeeper.ZooKeeper)
    12 [2019-04-03 23:59:19,624] INFO Client environment:java.library.path=/usr/java/packages/lib/i386:/lib:/usr/lib (org.apache.zookeeper.ZooKeeper)
    13 [2019-04-03 23:59:19,624] INFO Client environment:java.io.tmpdir=/tmp (org.apache.zookeeper.ZooKeeper)
    14 [2019-04-03 23:59:19,624] INFO Client environment:java.compiler=<NA> (org.apache.zookeeper.ZooKeeper)
    15 [2019-04-03 23:59:19,624] INFO Client environment:os.name=Linux (org.apache.zookeeper.ZooKeeper)
    16 [2019-04-03 23:59:19,624] INFO Client environment:os.arch=i386 (org.apache.zookeeper.ZooKeeper)
    17 [2019-04-03 23:59:19,624] INFO Client environment:os.version=2.6.32-358.el6.i686 (org.apache.zookeeper.ZooKeeper)
    18 [2019-04-03 23:59:19,624] INFO Client environment:user.name=root (org.apache.zookeeper.ZooKeeper)
    19 [2019-04-03 23:59:19,626] INFO Client environment:user.home=/root (org.apache.zookeeper.ZooKeeper)
    20 [2019-04-03 23:59:19,628] INFO Client environment:user.dir=/home/hadoop/soft/kafka_2.11-2.1.0 (org.apache.zookeeper.ZooKeeper)
    21 [2019-04-03 23:59:19,632] INFO Initiating client connection, connectString=slaver1:2181,slaver2:2181,slaver3:2181 sessionTimeout=6000 watcher=kafka.zookeeper.ZooKeeperClient$ZooKeeperClientWatcher$@33f1a9 (org.apache.zookeeper.ZooKeeper)
    22 [2019-04-03 23:59:19,712] INFO [ZooKeeperClient] Waiting until connected. (kafka.zookeeper.ZooKeeperClient)
    23 [2019-04-03 23:59:19,773] INFO Opening socket connection to server slaver3/192.168.110.132:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
    24 [2019-04-03 23:59:19,856] INFO Socket error occurred: slaver3/192.168.110.132:2181: No route to host (org.apache.zookeeper.ClientCnxn)
    25 [2019-04-03 23:59:19,962] INFO Opening socket connection to server slaver2/192.168.110.131:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
    26 [2019-04-03 23:59:19,977] INFO Socket error occurred: slaver2/192.168.110.131:2181: No route to host (org.apache.zookeeper.ClientCnxn)
    27 [2019-04-03 23:59:20,078] INFO Opening socket connection to server slaver1/192.168.110.130:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
    28 [2019-04-03 23:59:20,084] INFO Socket connection established to slaver1/192.168.110.130:2181, initiating session (org.apache.zookeeper.ClientCnxn)
    29 [2019-04-03 23:59:20,147] INFO Session establishment complete on server slaver1/192.168.110.130:2181, sessionid = 0x1000015a06e0000, negotiated timeout = 6000 (org.apache.zookeeper.ClientCnxn)
    30 [2019-04-03 23:59:20,167] INFO [ZooKeeperClient] Connected. (kafka.zookeeper.ZooKeeperClient)
    31 [2019-04-03 23:59:20,870] INFO Cluster ID = WpYBrjf9Sq-OOttPUbLbWA (kafka.server.KafkaServer)
    32 [2019-04-03 23:59:20,892] ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
    33 kafka.common.InconsistentBrokerIdException: Configured broker.id 1 doesn't match stored broker.id 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).
    34     at kafka.server.KafkaServer.getBrokerIdAndOfflineDirs(KafkaServer.scala:686)
    35     at kafka.server.KafkaServer.startup(KafkaServer.scala:209)
    36     at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:38)
    37     at kafka.Kafka$.main(Kafka.scala:75)
    38     at kafka.Kafka.main(Kafka.scala)
    39 [2019-04-03 23:59:20,899] INFO shutting down (kafka.server.KafkaServer)
    40 [2019-04-03 23:59:20,909] INFO [ZooKeeperClient] Closing. (kafka.zookeeper.ZooKeeperClient)
    41 [2019-04-03 23:59:20,926] INFO EventThread shut down for session: 0x1000015a06e0000 (org.apache.zookeeper.ClientCnxn)
    42 [2019-04-03 23:59:20,929] INFO Session: 0x1000015a06e0000 closed (org.apache.zookeeper.ZooKeeper)
    43 [2019-04-03 23:59:20,952] INFO [ZooKeeperClient] Closed. (kafka.zookeeper.ZooKeeperClient)
    44 [2019-04-03 23:59:20,971] INFO shut down completed (kafka.server.KafkaServer)
    45 [2019-04-03 23:59:20,998] ERROR Exiting Kafka. (kafka.server.KafkaServerStartable)
    46 [2019-04-03 23:59:21,034] INFO shutting down (kafka.server.KafkaServer)

    截图如下所示:

    2、解决如下所示:

     

    修改为和server.properties配置文件里面一样的broker.id一样的值。

    然后再启动就行了。

    1 [root@slaver1 kafka_2.11-2.1.0]# bin/kafka-server-start.sh config/server.properties

    待续.....

  • 相关阅读:
    vue学习指南:第六篇(详细)
    Android Stuido代码混淆
    Android 2018最新的三方库
    使用Git上传代码到Github仓库
    android展示注册进度效果源码
    JPTabBar 详细介绍
    利用HTML5和echarts开发大数据展示及大屏炫酷统计系统
    Android Studio Git 分支使用实践
    RecyclerView的Item的单击事件
    Android实用代码
  • 原文地址:https://www.cnblogs.com/biehongli/p/10654983.html
Copyright © 2020-2023  润新知