java.lang.RuntimeException: A broker is already registered on the path /brokers/ids/0. This probably indicates that you either have configured a brokerid that is already in use, or else you have shutdown this broker and restarted it faster than the zookeeper timeout so it appears to be re-registering.

Stack Overflow | brain storm | 2 months ago
  1. 0

    error while starting kafka broker

    Stack Overflow | 2 months ago | brain storm
    java.lang.RuntimeException: A broker is already registered on the path /brokers/ids/0. This probably indicates that you either have configured a brokerid that is already in use, or else you have shutdown this broker and restarted it faster than the zookeeper timeout so it appears to be re-registering.
  2. 0

    Sometimes, broker startup fails with the following exception [2011-10-03 15:33:22,193] INFO Awaiting connections on port 9092 (kafka.network.Acceptor) [2011-10-03 15:33:22,193] INFO Registering broker /brokers/ids/0 (kafka.server.KafkaZooKeeper) [2011-10-03 15:33:22,229] INFO conflict in /brokers/ids/0 data: 10.98.20.109-1317681202194:10.98.20.109:9092 stored data: 10.98.20.109-1317268078266:10.98.20.109:9092 (kafka.utils.ZkUtils$) [2011-10-03 15:33:22,230] FATAL org.I0Itec.zkclient.exception.ZkNodeExistsException: org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists for /brokers/ids/0 (kafka.server.KafkaServer) [2011-10-03 15:33:22,231] FATAL org.I0Itec.zkclient.exception.ZkNodeExistsException: org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists for /brokers/ids/0 at org.I0Itec.zkclient.exception.ZkException.create(ZkException.java:55) at org.I0Itec.zkclient.ZkClient.retryUntilConnected(ZkClient.java:685) at org.I0Itec.zkclient.ZkClient.create(ZkClient.java:304) at org.I0Itec.zkclient.ZkClient.createEphemeral(ZkClient.java:328) at kafka.utils.ZkUtils$.createEphemeralPath(ZkUtils.scala:55) at kafka.utils.ZkUtils$.createEphemeralPathExpectConflict(ZkUtils.scala:71) at kafka.server.KafkaZooKeeper.registerBrokerInZk(KafkaZooKeeper.scala:54) at kafka.log.LogManager.startup(LogManager.scala:122) at kafka.server.KafkaServer.startup(KafkaServer.scala:77) at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:40) at kafka.Kafka$.main(Kafka.scala:56) at kafka.Kafka.main(Kafka.scala) Caused by: org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists for /brokers/ids/0 at org.apache.zookeeper.KeeperException.create(KeeperException.java:110) at org.apache.zookeeper.KeeperException.create(KeeperException.java:42) at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:637) at org.I0Itec.zkclient.ZkConnection.create(ZkConnection.java:87) at org.I0Itec.zkclient.ZkClient$1.call(ZkClient.java:308) at org.I0Itec.zkclient.ZkClient$1.call(ZkClient.java:304) at org.I0Itec.zkclient.ZkClient.retryUntilConnected(ZkClient.java:675) ... 10 more (kafka.server.KafkaServer) [2011-10-03 15:33:22,231] INFO Shutting down... (kafka.server.KafkaServer) [2011-10-03 15:33:22,232] INFO shutdown scheduler kafka-logcleaner- (kafka.utils.KafkaScheduler) [2011-10-03 15:33:22,239] INFO shutdown scheduler kafka-logflusher- (kafka.utils.KafkaScheduler) [2011-10-03 15:33:22,481] INFO zkActor stopped (kafka.log.LogManager) [2011-10-03 15:33:22,482] INFO Closing zookeeper client... (kafka.server.KafkaZooKeeper) [2011-10-03 15:33:22,482] INFO Terminate ZkClient event thread. (org.I0Itec.zkclient.ZkEventThread) There could be 3 things that might have happened (1) you restarted kafka within the zk timeout, in which case as far as zk is concerned your old broker still exists...this is weird but actually correct behavior, (2) you have two brokers with the same id, (3) zk has a bug and is not deleting ephemeral nodes. Instead of just throwing the ZK NodeExistsException, we should include the above information in a well-named Kafka exception, for clarity.

    Apache's JIRA Issue Tracker | 5 years ago | Neha Narkhede
    java.lang.RuntimeException: A broker is already registered on the path /brokers/ids/0. This probably indicates that you either have configured a brokerid that is already in use, or else you have shutdown this broker and restarted it faster than the zookeeper timeout so it appears to be re-registering.
  3. 0

    1. Install Ambari with 3 nodes, example hostname01, hostname02, hostname03 2. Install Kafka service on hostname03. Kafka starts successfully 3. Go to hostname02 and add Kafka Broker. Start kafka broker and it will fail with below error: {code} [2015-08-05 17:13:51,306] FATAL Fatal error during KafkaServerStartable startup. Prepare to shutdown (kafka.server.KafkaServerStartable) java.lang.RuntimeException: A broker is already registered on the path /brokers/ids/0. This probably indicates that you either have configured a brokerid that is already in use, or else you have shutdown this broker and restarted it faster than the zookeeper timeout so it appears to be re-registering. at kafka.utils.ZkUtils$.registerBrokerInZk(ZkUtils.scala:174) at kafka.server.KafkaHealthcheck.register(KafkaHealthcheck.scala:58) at kafka.server.KafkaHealthcheck.startup(KafkaHealthcheck.scala:45) at kafka.server.KafkaServer.startup(KafkaServer.scala:124) at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:29) at kafka.Kafka$.main(Kafka.scala:46) at kafka.Kafka.main(Kafka.scala) {code} The 2nd broker added on hostname02 failed to start because it was assigned the same brokerid as the broker installed on hostname03. The brokerid is assigned to a broker in kafka.py: {code} brokerid = str(sorted(params.kafka_hosts).index(params.hostname)) kafka_server_config['broker.id'] = brokerid {code} params.py gets the kafka_hosts from clusterHostInfo: {code} kafka_hosts = config['clusterHostInfo']['kafka_broker_hosts'] {code} clusterHostInfo maintains the list of kafka brokers in order: {code} "kafka_broker_hosts": [ "hostname02", "hostname03" ], {code} Since the brokerid is the index of the hostname, and the broker on hostname03 was added first, it was at index 0. After adding a new broker on hostname02, it was inserted to the list at index 0 and hostname03 was moved to index 1. Because the broker on hostname03 was not restarted, it was still running with brokerid 0, so the broker on hostname02 with brokerid 0 was unable to start. Workaround: Restart all brokers

    Apache's JIRA Issue Tracker | 1 year ago | Carita Ou
    java.lang.RuntimeException: A broker is already registered on the path /brokers/ids/0. This probably indicates that you either have configured a brokerid that is already in use, or else you have shutdown this broker and restarted it faster than the zookeeper timeout so it appears to be re-registering.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [Kafka-users] Failed to launch 0.8 stable server - Grokbase

    grokbase.com | 6 months ago
    java.lang.RuntimeException: A broker is already registered on the path /brokers/ids/1. This probably indicates that you either have configured a brokerid that is already in use, or else you have shutdown this broker and restarted it faster than the zookeeper timeout so it appears to be re-registering.
  6. 0

    GitHub comment 72#180098171

    GitHub | 10 months ago | wurstmeister
    java.lang.RuntimeException: A broker is already registered on the path /brokers/ids/1003. This probably indicates that you either have configured a brokerid that is already in use, or else you have shutdown this broker and restarted it faster than the zookeeper timeout so it appears to be re-registering.

    3 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.RuntimeException

      A broker is already registered on the path /brokers/ids/0. This probably indicates that you either have configured a brokerid that is already in use, or else you have shutdown this broker and restarted it faster than the zookeeper timeout so it appears to be re-registering.

      at kafka.utils.ZkUtils.registerBrokerInZk()
    2. Apache Kafka
      Kafka.main
      1. kafka.utils.ZkUtils.registerBrokerInZk(ZkUtils.scala:305)
      2. kafka.utils.ZkUtils.registerBrokerInZk(ZkUtils.scala:291)
      3. kafka.server.KafkaHealthcheck.register(KafkaHealthcheck.scala:70)
      4. kafka.server.KafkaHealthcheck.startup(KafkaHealthcheck.scala:51)
      5. kafka.server.KafkaServer.startup(KafkaServer.scala:244)
      6. kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:37)
      7. kafka.Kafka$.main(Kafka.scala:67)
      8. kafka.Kafka.main(Kafka.scala)
      8 frames