启动 Docker Swarm 时出现问题!

启动 Docker Swarm 时出现问题!

现在我尝试启动 Docker Swarm,但是当我尝试启动 Docker Swarm 时出现以下错误:

[lör jul 04 13:39:15] Jonathan@Whats next?:~$ sudo docker swarm init
[sudo] password for jonteyh: 
Error response from daemon: could not choose an IP address to advertise since this system has multiple addresses on interface wlo1 (fdaa:bbcc:ddee:0:380a:17d2:ce59:aed3 and fdaa:bbcc:ddee:0:ec7a:ccd0:18b8:d9bf) - specify one with --advertise-addr

答案1

您的主机有多个 IP 地址,因此您需要为群体广告目的指定一个 IP 地址:

sudo docker swarm init --advertise-addr <IP_address>

这个例子来自docker docs:

docker swarm init --advertise-addr 192.168.99.121
Swarm initialized: current node (bvz81updecsj6wjz393c09vti) is now a manager.

To add a worker to this swarm, run the following command:

    docker swarm join \
    --token SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx \
    172.17.0.2:2377

To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.

我建议使用连接到子网的 IP 地址,从该地址可以访问其他工作节点。

相关内容