The problem is connecting the kafa from the outside

I am using the hortonwork sandbox for the kafka server trying to connect kafka from eclipse using java code. Use this configuration to connect to the manufacturer 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 the sandbox I'm connecting to

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

port forwarding was also performed

I can connect to the kafka server from eclipse, but when sending a message I get an exception Exception "Failed to send messages after 3 attempts."

+4
source share
1 answer

, Hortonworks Sandbox VM, :

http://hortonworks.com/community/forums/topic/use-host-only-networking-for-the-virtual-machine/

Sandbox IP (, 192.168.56.101), SSH,

$ ssh root@192.168.56.101

Ambari http://192.168.56.101:8080/ Kafka

listeners=PLAINTEXT://0.0.0.0:6667
advertised.listeners=PLAINTEXT://192.168.56.101:6667 

" -" (. http://hortonworks.com/community/forums/topic/ambari-alerts-how-to-change-kafka-port/).

/ Kafka Ambari. Kafka Hortonworks Sandbox VM. ( ), , , Kafka Kafka,

$ bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
$ bin/kafka-console-producer.sh --topic test --broker-list 192.168.56.101:6667
+6

All Articles