Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-12745

Kafka with 2.7.0 version service start failing while making zookeeper connection calls with java.lang.NoSuchMethodError: 'void org.apache.zookeeper.ZooKeeper.<init>...'

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Invalid
    • Affects Version/s: 2.7.0
    • Fix Version/s: None
    • Component/s: controller, zkclient
    • Labels:
      None
    • Environment:
      development

      Description

      I have an existing Kafka setup working as below -

      Kafka - 2.4.1 (3 brokers)
      Zookeeper - 3.6.2 (3 nodes)
      

      Now I am trying to upgrade the Kafka version to 2.7.0, but when I downloaded the binary and trying to start the service, it is failing while making the connection with the zookeeper, it's not giving the errorĀ java.lang.NoSuchMethodError: 'void org.apache.zookeeper.ZooKeeper.<init>(java.lang.String, int, org.apache.zookeeper.Watcher, org.apache.zookeeper.client.ZKClientConfig)'

      More error trace:

      INFO Registered kafka:type=kafka.Log4jController MBean (kafka.utils.Log4jControllerRegistration$)
      INFO Setting -D jdk.tls.rejectClientInitiatedRenegotiation=true to disable client-initiated TLS renegotiation (org.apache.zookeeper.common.X509Util)
      INFO Registered signal handlers for TERM, INT, HUP (org.apache.kafka.common.utils.LoggingSignalHandler)
      INFO starting (kafka.server.KafkaServer)
      INFO Connecting to zookeeper on 10.1.13.74:2181,10.1.12.213:2181,10.1.11.190:2181 (kafka.server.KafkaServer)
      INFO [ZooKeeperClient Kafka server] Initializing a new session to 10.1.13.74:2181,10.1.12.213:2181,10.1.11.190:2181. (kafka.zookeeper.ZooKeeperClient)
      INFO Client environment:zookeeper.version=3.4.13-2d71af4dbe22557fda74f9a9b4309b15a7487f03, built on 06/29/2018 00:39 GMT (org.apache.zookeeper.ZooKeeper)
      INFO Client environment:host.name=ip-10-1-11-139.ec2.internal (org.apache.zookeeper.ZooKeeper)
      INFO Client environment:java.version=11.0.9.1 (org.apache.zookeeper.ZooKeeper)
      INFO Client environment:java.vendor=Red Hat, Inc. (org.apache.zookeeper.ZooKeeper)
      INFO Client environment:java.home=/usr/lib/jvm/java-11-openjdk-11.0.9.11-2.el7_9.x86_64 (org.apache.zookeeper.ZooKeeper)
      ...
      ...
          [2021-04-29 11:37:52,874] INFO Client environment:java.library.path=/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib (org.apache.zookeeper.ZooKeeper)
      [2021-04-29 11:37:52,874] INFO Client environment:java.io.tmpdir=/tmp (org.apache.zookeeper.ZooKeeper)
      [2021-04-29 11:37:52,874] INFO Client environment:java.compiler=<NA> (org.apache.zookeeper.ZooKeeper)
      [2021-04-29 11:37:52,874] INFO Client environment:os.name=Linux (org.apache.zookeeper.ZooKeeper)
      [2021-04-29 11:37:52,874] INFO Client environment:os.arch=amd64 (org.apache.zookeeper.ZooKeeper)
      [2021-04-29 11:37:52,874] INFO Client environment:os.version=3.10.0-1160.24.1.el7.x86_64 (org.apache.zookeeper.ZooKeeper)
      [2021-04-29 11:37:52,874] INFO Client environment:user.name=kafka (org.apache.zookeeper.ZooKeeper)
      [2021-04-29 11:37:52,874] INFO Client environment:user.home=/home/kafka (org.apache.zookeeper.ZooKeeper)
      [2021-04-29 11:37:52,874] INFO Client environment:user.dir=/srv/kafka/2.13-2.7.0/kafka_2.13-2.7.0 (org.apache.zookeeper.ZooKeeper)
      ...
      ...
      ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
      java.lang.NoSuchMethodError: 'void org.apache.zookeeper.ZooKeeper.<init>(java.lang.String, int, org.apache.zookeeper.Watcher, org.apache.zookeeper.client.ZKClientConfig)'
      at kafka.zookeeper.ZooKeeperClient.<init>(ZooKeeperClient.scala:111)
      at kafka.zk.KafkaZkClient$.apply(KafkaZkClient.scala:1881)
      at kafka.server.KafkaServer.createZkClient$1(KafkaServer.scala:441)
      at kafka.server.KafkaServer.initZkClient(KafkaServer.scala:466)
      at kafka.server.KafkaServer.startup(KafkaServer.scala:233)
      at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:44)
      at kafka.Kafka$.main(Kafka.scala:82)
      at kafka.Kafka.main(Kafka.scala)
      INFO shutting down (kafka.server.KafkaServer)
      INFO App info kafka.server for 12 unregistered (org.apache.kafka.common.utils.AppInfoParser)
      INFO shut down completed (kafka.server.KafkaServer)
      ERROR Exiting Kafka. (kafka.server.KafkaServerStartable)
      INFO shutting down (kafka.server.KafkaServer)
      kafka.service: main process exited, code=exited, status=1/FAILURE

      I also tried to start service in DEBUG mode but still not giving much information on why it's not able to make the connection with the zookeeper, from logs it's clear that it has initiated a zookeeper connection.

      Another thing which I suspect is why it is giving zookeeper version 3.4.13 when my zookeeper server(which is on another machine) is version 3.6.2

      INFO Client environment:zookeeper.version=3.4.13-2d71af4dbe22557fda74f9a9b4309b15a7487f03, built on 06/29/2018 00:39 GMT (org.apache.zookeeper.ZooKeeper)
      

      If I switch back to using Kafka 2.4.1 & everything else as is it works fine, but not sure whats the problem with Kafka version 2.7.x/2.6.x

      Any help would be greatly appreciated.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Sencha7 Ramesh Sencha
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: