Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Issue in connecting Kafka from outside Sandbox

Solved Go to solution

Issue in connecting Kafka from outside Sandbox

Contributor

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

Accepted Solutions
Highlighted

Re: Issue in connecting Kafka from outside Sandbox

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
Highlighted

Re: Issue in connecting Kafka from outside Sandbox

Contributor

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
Highlighted

Re: Issue in connecting Kafka from outside Sandbox

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

Don't have an account?
Coming from Hortonworks? Activate your account here