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

Cannot produce messages remotely: No partition metadata for topic test due to kafka.common.LeaderNotAvailableException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Not A Problem
    • 0.8.2.1
    • 0.8.1.2
    • producer
    • None
    • CentOS 7 / Oracle jdk1.8.0_45

    Description

      I successfully ran the QuickStart tutorial locally on a single EC2 machine. I stopped everything running on the server, deleted the logs in /tmp, and added the single line "advertised.host.name=MY.EXTERNAL.IP" to server.properties. (Port 9092 is indeed allowed through the firewall and responding, so no problem there.)

      I then restarted the server and successfully created a topic as per the QuickStart tutorial.

      Then, I ran the producer in exactly the same way as in the QuickStart tutorial, except on a remote machine:

      bin/kafka-console-producer.sh --broker-list MY.EXTERNAL.IP:9092 --topic test

      This generates the following error:

      WARN Error while fetching metadata [

      {TopicMetadata for topic test123 -> No partition metadata for topic test123 due to kafka.common.LeaderNotAvailableException}

      ] for topic [test123]: class kafka.common.LeaderNotAvailableException (kafka.producer.BrokerPartitionInfo)

      See also: http://stackoverflow.com/questions/30880811/kafka-quickstart-advertised-host-name-gives-kafka-common-leadernotavailableexce/30919109#30919109

      I've spent several evenings trying to get this simple Kafka setup to work but am stuck. It seems like it should work.

      Attachments

        Activity

          People

            junrao Jun Rao
            mikebridge Mike Bridge
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: