[ 
https://issues.apache.org/jira/browse/KAFKA-2286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mike Bridge resolved KAFKA-2286.
--------------------------------
       Resolution: Not A Problem
    Fix Version/s: 0.8.1.2

This turns out to be a problem with my configuration.  it was a 
firewall/routing issue, but between zookeeper and the broker on the same 
machine, not between my client and the machine hosting zookeeper and the 
broker.  Zookeeper uses the external IP address it receives from the 
advertised.host.name to connect back to the broker.  So everything worked when 
it was not set---I think it must default to localhost---but it the two couldn't 
communicate when it was connecting to the broker on same machine via its 
external IP.

I fixed this with a route back so that it goes back through NAT to itself.

It's probably a pretty obscure situation, but it might help to have a clearer 
error when the zookeeper can't contact the broker.

> Cannot produce messages remotely: No partition metadata for topic test due to 
> kafka.common.LeaderNotAvailableException
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-2286
>                 URL: https://issues.apache.org/jira/browse/KAFKA-2286
>             Project: Kafka
>          Issue Type: Bug
>          Components: producer 
>    Affects Versions: 0.8.2.1
>         Environment: CentOS 7 /  Oracle jdk1.8.0_45 
>            Reporter: Mike Bridge
>            Assignee: Jun Rao
>            Priority: Critical
>             Fix For: 0.8.1.2
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to