I have set up an AWS cluster of 3 nodes.I have modified the /etc/hosts file for the nodes which looks something like this
172.31.9.2 kafka1
172.31.9.2 zookeeper1
172.31.19.230 kafka2
172.31.19.230 zookeeper2
172.31.35.20 kafka3
172.31.35.20 zookeeper3
when I run the command from one of the nodes
bin/kafka-console-consumer.sh --bootstrap-server kafka1:9092 --topic first_topic --from-beginning
it works but when I replace the hostname by ip and run it with the below command
bin/kafka-console-consumer.sh --bootstrap-server 172.31.9.2:9092 --topic first_topic --from-beginning
it does not work. Do I need to change certain configs?
kafka-console-consumer
from? The nodes, or somewhere else (e.g. your local machine)? – Robin Moffatt