Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Issue in connecting Kafka from outside Sandbox

avatar
Rising Star

I am using hortonwork Sandbox for kafka server trying to connect kafka from eclipse with java code . Use this configuration to connect to producer to send the message

metadata.broker.list=sandbox.hortonworks.com:45000
serializer.class=kafka.serializer.DefaultEncoder
zk.connect=sandbox.hortonworks.com:2181
request.required.acks=0
producer.type=sync

where sandbox.hortonworks.com is sandboxname to whom i connect

in kafka server.properties I changed this configuration

host.name=sandbox.hortonworks.com

advertised.host.name=System IP(on which my eclipse is running)
advertised.port=45000

did the port forwarding also ,

I am able to connect to kafka server from eclipse but while sending the message get the exception Exception"Failed to send messages after 3 tries."

1 ACCEPTED SOLUTION

avatar

Kafka installed by ambari uses host.name=FQDN of the host. This causes kafka to bind on hostname only. Did you try adding sandbox.hortonworks.com along with ip to /etc/hosts on your desktop.

View solution in original post

2 REPLIES 2

avatar
Rising Star

I don't see where you specified the topic to which you want to send your message. Ensure you are setting the following Kafka property and that the topic has been created in Kafka. Other than that, everything else looks good.

kafka.topic=yourTopicName

avatar

Kafka installed by ambari uses host.name=FQDN of the host. This causes kafka to bind on hostname only. Did you try adding sandbox.hortonworks.com along with ip to /etc/hosts on your desktop.