You’re right that one of the listeners (LISTENER_FRED) is listening on port 9092 on localhost. When we access the broker using 9092 that’s the listener address that’s returned to us.
The reason we can access it as kafka0:9092 is that kafka0 in our example can resolve to the broker from the machine running kafkacat. Probably using this in our example would have been clearer, but the effect is the same:
Yes, I think in the example, unless you have a host configuration: localhost kafka0, even if kafka0 can resolve to the broker, it still doesn’t work because broker is listening to localhost instead of kafka0.But bind 0.0.0.0, as you said, and that won’t be a problem.So If you have time, could you please modify your blog?
Another question in your blog, when in AWS/IAAS and External address IS resolvable locally ,you give the config:advertised.listeners=PLAINTEXT://ec2-54-191-84-122.us-west-2.compute.amazonaws.com:9092.I want to know if advertised.listener is not required ,and just listeners=PLAINTEXT://ec2-54-191-84-122.us-west-2.compute.amazonaws.com:9092 is enough?
I would say go ahead and try it It’s a while since I wrote the blog, and what I tried and wrote back then was true and accurate. For specific instances like you describe I would work through from the principles described and use them to troubleshoot if it doesn’t work. Advertised listener is fundamentally “what is the host on which this broker can be reached by clients”. I’m not sure what would be gained from trying to shortcut that and specify listeners only.