This image works wonderfully.
Just I am a little confused with the config "ADVERTISED LISTENER". It is not a required configuration outside docker, so why is it needed in docker?
(To my understanding, it is written in doc that "Listeners to publish to ZooKeeper for clients to use", so why will clients query from zookeeper, when I have provide them kafka ips directly?)
The text was updated successfully, but these errors were encountered:
@schmichri Thanks for answering. Sorry I may have not state the question clearly. I'm confused why zookeeper want to know "who it(kafka) is" on the outside world. It is actually a question about behavior between zookeeper and kafka. Really a naive one though, finally got it after reading kafka doc carefully.
When a client connect to a Kafka cluster by specifying "bootstrap.servers=...", it do not have to be a full list of all Kafka brokers, because client doesn't use it to send data to Kafka directly. Rather, client will somehow find zookeeper, and get the whole list of Kafka brokers(may be part of them that are needed for certain topic) from zookeeper. So "ADVERTISED_LISTENER" is used for client to connect to Kafka.
I used to thought that "ADVERTISED_LISTENER" is just used for zookeeper to communicate with all Kafka brokers. If so, it is really confused why the intranet address(which is the default value) do not work. Turns out a misunderstanding :P