Docker swimming mode. What is the difference between --advertise-addr and -listen-addr?

I am new to the cluster. I do not see the difference between the two options? I think the ad address is used by other nodes to communicate with each other, and addr listening is used by the hosts to join the cluster. Therefore, I think that these two addr will always be the same. I'm right?

+4
source share
2 answers

Leaving --listen-addron it, by default 0.0.0.0:2377 tells it to listen on all interfaces for requests. You can use this to restrict Swarm to only listen on certain interfaces if you have something like a management network that is separate from the public network on your nodes.

--advertise-addr is the address given to other nodes in Swarm to establish connections and should be an address that everyone can decide and reach.

Note that early RC 1.12 did not have --advertise-addr, so you can find some instructions indicating --listen-addr. I would ignore them and use them --advertise-addronly if you have a specific use case.

+5
source

, addr - , , .. 0.0.0.0:<port> , ip addr. 192.168.1.1:<port> , .

+2

Source: https://habr.com/ru/post/1650410/


All Articles