kafka-python (1.0.0) throws error while connecting to the broker. At the same time /usr/bin/kafka-console-producer and /usr/bin/kafka-console-consumer work fine.
Pyt
A host could have multiple dns aliases. Any of them would work for ssh or ping test. However kafka connection should use the alias that matches advertised.host.name
in server.properties
file of the broker.
I was using a different alias in bootstrap_servers
parameter. Hence an error. Once I changed the call to use advertised.hostname
, the problem was solved