是否可以为一个管理器节点发布多个 IP 地址?

Is it possible to advertise multiple ip addresses for a manager node?

假设我想从位于两个子网 10.0.0.0/24 和 192.168.0.0/24 之间的机器初始化一个新群,地址为 10.0.0.1 和 192.168.0.1。

现在我有一个地址为 10.0.0.2 的工作节点和另一个地址为 192.168.0.2 的工作节点。

为了避免将来可能出现的错误,我想用地址 10.0.0.1 和 192.168.0.1 公布我的管理器节点,这样如果发生什么事情,我的工作节点将尝试重新连接到它们所在的子网中的地址在.

我该怎么做?

谢谢!

我认为这是不可能的,正如 Docks 中引用的那样:

--advertise-addr

This flag specifies the address that will be advertised to other members of the swarm for API access and overlay networking. If unspecified, Docker will check if the system has a single IP address, and use that IP address with the listening port (see --listen-addr). If the system has multiple IP addresses, --advertise-addr must be specified so that the correct address is chosen for inter-manager communication and overlay networking.

It is also possible to specify a network interface to advertise that interface’s address; for example --advertise-addr eth0:2377.

Specifying a port is optional. If the value is a bare IP address or interface name, the default port 2377 will be used.

source