ogdabou
ogdabou

Reputation: 592

kafka + zookeeper remote = error

I am trying to install a kafka & zookeeper instance on a remote server. I only need 1 node of each actually because i only want to provide remote kafka for test purposes.

Kafka and Zookeeper are running from the Apache Kafka tarball you can find there (v0.0.9), inside a Docker image.

Trying to consume / produce using the provided scripts. And trying to produce using own java application. Everythinf is working fine if Kafka & ZK are installed on the local server.

Here is the error I get while trying to produce :

BrokerPartitionInfo:83 - Error while fetching metadata [{TopicMetadata for topic RSS ->
No partition metadata for topic RSS due to kafka.common.LeaderNotAvailableException}] for topic [RSS]: class kafka.common.LeaderNotAvailableException

Kafka properties tested

First :

borker.id=0
port=9092
host.name=<external-ip>
zookeeper.connect=localhost:<PORT>

Second:

borker.id=0
port=9092
host.name=<external-ip>
zookeeper.connect=<external-ip>:<PORT>

Third:

borker.id=0
port=9092
host.name=<external-ip>
zookeeper.connect=<external-ip>:<PORT>
advertised.host.name=<external-ip>
advertised.host.port=<external-ip>

Last:

borker.id=0
port=9092
host.name=</etc/host name>
zookeeper.connect=<external-ip>:<PORT>
advertised.host.name=<external-ip>
advertised.host.port=<external-ip>

Here is my "/etc/hosts"

127.0.0.1 kafka kafka
127.0.0.1 localhost  

I followed the Getting Started, which if I understood is a localhost / signle server configurations. I cannot understand what I have to do to get this work with remote calls...

Thanks for your help !


EDIT 1

host.name=localhost
advertised.host.name=politik.cm-cloud.fr

Seems to allow a local consumer (on the server) and producer. But if we want to do the same from a remote server we get

[2015-12-09 12:44:10,826] WARN Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect (org.apache.zookeeper.ClientCnxn)
java.net.NoRouteToHostException: No route to host

Upvotes: 0

Views: 1685

Answers (1)

vasa.v03
vasa.v03

Reputation: 157

The error does not look like connectivity problem with Zookeeper / Kafka. Just follow the instruction in "quickstart" from http://kafka.apache.org/

BrokerPartitionInfo:83 - Error while fetching metadata [{TopicMetadata for topic RSS ->

Additionally the error indicates there is no partition info i.e topic not yet created . Try creating topics first and then try to produce/consume because when producing to a non existent topic kafka will create the topic based on auto.create.topics.enable in server.properties but remotely it is better to create topics rathen than relying on auto create

Upvotes: 0

Related Questions