While producing message in kafka, i am getting the following error :
$ bin/kafka-console-producer.sh --broker-list localhost:9092 --topic nil_PF1_P1
hi
hello
I faced similar problem, where I was able to produce and consume on localhost
but not from different machines on network. Based few answers I got the clue that essentially we need to expose advertised.listener
to producer and consumer, however giving 0.0.0.0 was also not working. So gave exact IP against advertised.listeners
advertised.listeners=PLAINTEXT://HOST.IP:9092
And I left listener=PLAINTEXT://:9092
as it is.
So with this the spark exposes advertised ip and port to producers and consumers