Docker1.12 Worker 无法加入集群(Swarm:待定)

2023-11-23

经理版Docker version 1.12.0-rc5, build a3f2063,

工人版Docker version 1.12.0-rc5, build a3f2063.

创建 Swarm 管理器:

docker swarm init --advertise-addr "172.25.30.2:4243"

    Swarm initialized: current node (3kmewyb10p8xj3ke5rpjyw4s8) is now a manager.

    To add a worker to this swarm, run the following command:
        docker swarm join \
        --token SWMTKN-1-5lwzvv7au6hosiqqmdwmcxvmlmhtz4ts04jsg06284fq3posn0-enq26dqnwma38ij48hymtnioq \
        172.25.30.2:4243

    To add a manager to this swarm, run the following command:
        docker swarm join \
        --token SWMTKN-1-5lwzvv7au6hosiqqmdwmcxvmlmhtz4ts04jsg06284fq3posn0-85cwe5pf779qw0knjn6wxdbim \
        172.25.30.2:4243

然后创建了工人

docker swarm join --token SWMTKN-1-5lwzvv7au6hosiqqmdwmcxvmlmhtz4ts04jsg06284fq3posn0-enq26dqnwma38ij48hymtnioq 172.25.30.2:4243
    Error response from daemon: Timeout was reached before node was joined. Attempt to join the cluster will continue in the background. Use "docker info" command to see the current swarm status of your node.

我已经检查了工人的日志

time="2016-08-01T00:22:47.449844174-07:00" level=warning msg="failed to retrieve remote root CA certificate: rpc error: code = 1 desc = context canceled" 
time="2016-08-01T00:22:47.449962215-07:00" level=warning msg="failed to retrieve remote root CA certificate: rpc error: code = 1 desc = context canceled" 
time="2016-08-01T00:22:47.450025342-07:00" level=warning msg="failed to retrieve remote root CA certificate: rpc error: code = 1 desc = context canceled" 
time="2016-08-01T00:22:47.450081950-07:00" level=warning msg="failed to retrieve remote root CA certificate: rpc error: code = 1 desc = context canceled" 
time="2016-08-01T00:22:47.450142443-07:00" level=warning msg="failed to retrieve remote root CA certificate: rpc error: code = 1 desc = context canceled" 
time="2016-08-01T00:22:47.450202836-07:00" level=error msg="cluster exited with error: rpc error: code = 1 desc = context canceled" 
time="2016-08-01T00:23:31.351868722-07:00" level=error msg="Handler for POST /v1.24/swarm/join returned error: Timeout was reached before node was joined. Attempt to join the cluster will continue in the background. Use \"docker info\" command to see the current swarm status of your node."

In docker info,我看到了“Swarm:待定”

I did docker swarm update还!。尽管如此,该工作人员仍无法加入集群。那么,我该如何重新爱

UPDATE-1

卸载并删除配置文件,然后再次安装 docker 1.12 版本Docker version 1.12.0, build 8eab29e.

仍然面临同样的问题(无法加入并且“Swarm:Pending”docker info)有不同的错误/var/logs/upstat/docker.logs

time="2016-08-01T11:22:08.629760770-07:00" level=error msg="Handler for POST /v1.24/swarm/join returned error: Timeout was reached before node was joined. Attempt to join the cluster will continue in the background. Use \"docker info\" command to see the current swarm status of your node."

Thanks.


问题是,我试图加入错误的“端口”(如docker swarm init显示在输出中)。

1)在“docker swarm init”之前,docker仅在端口“4243”上运行。我已经检查过netstat -tulp | grep docker。所以我用那个端口做广告!

root@veeru:~# netstat -tulpn | grep docker
tcp6       0      0 :::4243                 :::*                    LISTEN      8750/dockerd 

root@veeru:~# docker swarm init --advertise-addr "172.25.30.2:4243"
Swarm initialized: current node (exvwgj0pu4cd124ljnblt9xff) is now a manager.

To add a worker to this swarm, run the following command:
    docker swarm join \
    --token SWMTKN-1-5j9mpo8hepue6g1sjdas33thr92w1o9hlef5auwqpbxs3glt39-6zomhgu204m9alq51f632nzas \
    172.25.30.2:4243

To add a manager to this swarm, run the following command:
    docker swarm join \
    --token SWMTKN-1-5j9mpo8hepue6g1sjdas33thr92w1o9hlef5auwqpbxs3glt39-axhgqgo4jqw4hv38x578m44wh \
    172.25.30.2:4243

2) After docker swarm init,docker正在使用4个端口运行,包括端口2377(netstat -tupln | grep docker).

root@veeru:~# netstat -tulp | grep docker
tcp6       0      0 [::]:2377               [::]:*                  LISTEN      8750/dockerd    
tcp6       0      0 [::]:7946               [::]:*                  LISTEN      8750/dockerd    
tcp6       0      0 [::]:4243               [::]:*                  LISTEN      8750/dockerd    
udp6       0      0 [::]:7946               [::]:*                              8750/dockerd

在第 1 点中,它告诉我们要运行docker swarm join带端口4243工作中。以前我也是这样跑的!(不行!)

后来我做到了docker swarm leave并与端口连接2377。现在我可以加入了!

docker swarm join --token SWMTKN-1-5j9mpo8hepue6g1sjdas33thr92w1o9hlef5auwqpbxs3glt39-6zomhgu204m9alq51f632nzas 172.25.30.2:2377
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Docker1.12 Worker 无法加入集群(Swarm:待定) 的相关文章

随机推荐