管理员版本Docker version 1.12.0-rc5, build a3f2063,
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."
在中docker info,我看到了“虫群:待定”
docker info
我也做到了docker swarm update!尽管如此,该工作人员仍无法加入集群。所以,我该怎么爱
docker swarm update
更新1
卸载并删除配置文件,然后再次安装docker 1.12版本Docker version 1.12.0, build 8eab29e。
Docker version 1.12.0, build 8eab29e
仍然面临着相同的问题(无法加入和中的“ Swarm:Pending” docker info),其中存在DIFFERENT错误/var/logs/upstat/docker.logs
/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."
谢谢。
问题是,我试图加入错误的“端口”(如docker swarm init输出所示)。
docker swarm init
1) 在“ docker swarm init”之前,docker仅在端口“ 4243”上运行。我已经核对了netstat -tulp | grep docker。所以我在那个港口做广告!
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) 之后docker swarm init,docker以4个端口(包括端口2377(netstat -tupln | grep docker))运行。
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点中,告诉在worker中docker swarm join使用port 运行4243。以前我确实是那样跑的!(它行不通!)
docker swarm join
4243
后来我docker swarm leave加入了端口 2377 。现在我可以加入了!
docker swarm leave
docker swarm join --token SWMTKN-1-5j9mpo8hepue6g1sjdas33thr92w1o9hlef5auwqpbxs3glt39-6zomhgu204m9alq51f632nzas 172.25.30.2:2377