I\'m trying to create a Kafka
cluster to send messages to a remote control. I have configured everything as described here.
I am running this on a Linux r
in
config/server.properties
I put this
listeners=PLAINTEXT://[server_ip]:9092
and it worked fine.
For quick testing, don't forget to use [server_ip] in the command line of kafka-consumer. Example:
/usr/local/kafka_2.11-2.0.0/kafka-console-consumer.sh --property print.timestamp=true --bootstrap-server [server_ip]:9092 --topic [you_topic]
I hope this may help you.
Regards
Ali
Tried connecting to kafka remote cluster from my local machine.
VM's had one internal (9.0.0.1) and one external IP (192.1.1.1). I could ssh only to the internal & not the external. I did these changes to my conifg/server.properties:
//set to the IP of the machine (find using ifconfig
or hostname -I
)
listeners=PLAINTEXT://192.1.1.1:9092
//set to the IP the consumer and producer will connect
advertised.listeners=PLAINTEXT://9.0.0.1:9092
Worked with
from server.properties
Uncomment
listeners=PLAINTEXT://:9092
And
advertised.listeners=PLAINTEXT://<HOST IP>:9092
Replace <HOST IP>
with actual IP.
In your kafka server.properties
there is a commented configuration
#advertised.host.name=<Some IP>
Uncomment this and add the IP of the Linux Machine in which kafka is running.
advertised.host.name=<Kafka Running Machine IP>
And connect from clients to <Kafka Running Machine IP>
This should fix your issue.
EDIT
Optionally you can uncomment the
#advertised.port=9092
Also if you are listening on a different port than the default one.