0
votes

I am aware that we can initialize a swarm using

docker swarm init

If the Node has multiple addresses then we need to add flag

--advertise-addr

and provide the IP Address . This flag is for mentioning the IP address to other Nodes in the swarm for API Access.

In a cluster of 5 manager node . MGR1 is the leader ( In this node I ran

docker swarm init --advertise-addr 192.6.2.2

) . Now If I delete this Node , the cluster will appoint another manager as leader by RAFT .

My question is , If that manager node which is going to be elected as leader has more than one IP address . Then how a single IP is set like the way --advertise-addr is used at first to initialize the cluster. ?

1

1 Answers

2
votes

The advertise address is local to a node, it's not a global cluster setting. That ip is the one displayed when you get a client join command from the server, because clients need an address to connect to. You should pick an address that any node in the cluster can reach.