Docker1.12工人无法加入群集(Swarm:Pending) [英] Docker1.12 Worker not able to join in cluster(Swarm: Pending)

查看:1148
本文介绍了Docker1.12工人无法加入群集(Swarm:Pending)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

管理器版本 Docker版本1.12.0-rc5,构建a3f2063



工作版本 Docker版本1.12.0-rc5,构建a3f2063



创建Swarm管理器:



$ pre> $ code> docker swarm init --advertise-addr172.25.30.2:4243

Swarm已初始化:当前节点(3kmewyb10p8xj3ke5rpjyw4s8)现在是一个经理。

要向此群组添加一个工作人员,请运行以下命令:
docker swarm join \
--token SWMTKN-1-5lwzvv7au6hosiqqmdwmcxvmlmhtz4ts04jsg06284fq3posn0-enq26dqnwma38ij48hymtnioq \
172.25.30.2:4243

要向此群组添加管理员,请运行以下命令:
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 
守护进程错误响应:在节点加入之前超时。尝试加入群集将在后台继续。使用docker info命令查看节点的当前群组状态。

我已检查工作中的日志

  time =2016-08-01T00:22:47.449844174-07:00level = warning msg =无法检索远程根CA证书:rpc error:code = 1 desc = context取消
time =2016-08-01T00:22:47.449962215-07:00level = warning msg =无法检索远程根CA证书:rpc error:code = 1 desc = context取消
time =2016-08-01T00:22:47.450025342-07:00level = warning msg =无法检索远程根CA证书:rpc error:code = 1 desc = context取消
time =
time = 01T00:22:47.450142443-07:00level = warning msg =无法检索远程根CA证书:rpc error:code = 1 desc = context取消
time =2016-08-01T00:22: 47.450202836-07:00level = error msg =cluster exited with error:rpc error:code = 1 de sc = context取消
time =2016-08-01T00:23:31.351868722-07:00level = error msg =POST / v1.24/swarm/join的处理程序返回错误:超时已到节点已加入。尝试加入群集将在后台继续。使用\docker info\命令查看节点当前的群组状态。

docker信息中,我看到Swarm:Pending



我做了 docker swarm update 还有,工作人员无法加入群集,所以,如何重新开发



UPDATE-1



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

仍然面临同样的问题(无法在 docker info )在 /var/logs/upstat/docker.logs中的DIFFERENT错误

  time =2016-08-01T11:22:08.629760770-07:00level = error msg =POST / v1.24/swarm/join的处理程序返回错误:节点加入之前已达到超时。尝试加入群集将在后台继续。使用\docker info\命令查看节点当前的群组状态。

谢谢。

解决方案

事情是,我试图加入错误的端口(As docker



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

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

root @veeru:〜#docker swarm init --advertise-addr172.25.30.2:4243
Swarm initialized:当前节点(exvwgj0pu4cd124ljnblt9xff)现在是一个经理

要添加一个工作器这个群组,运行以下命令:
docker swarm join \
--token SWMTKN-1-5j9mpo8hepue6g1sjdas33thr92w1o9hlef5auwqpbxs3glt39-6zom hgu204m9alq51f632nzas \
172.25.30.2:4243

要向此群组添加管理器,请运行以下命令:
docker swarm join \
--token SWMTKN -1-5j9mpo8hepue6g1sjdas33thr92w1o9hlef5auwqpbxs3glt39-axhgqgo4jqw4hv38x578m44wh \
172.25.30.2:4243

2在 docker swarm init 之后,码头服务器正在运行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 code> 4243 在工作。以前我没有像那样运行!(它不工作!)



稍后我做了$ code> docker swarm leave 并加入端口 2377 。现在我可以加入!

  docker swarm join --token SWMTKN-1-5j9mpo8hepue6g1sjdas33thr92w1o9hlef5auwqpbxs3glt39-6zomhgu204m9alq51f632nzas 172.25.30.2:2377 


Manager Version Docker version 1.12.0-rc5, build a3f2063,

Worker version Docker version 1.12.0-rc5, build a3f2063.

Created Swarm manger:

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

Then created worker

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.

I have checked logs in worker

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, I saw "Swarm: Pending"

I did docker swarm update also!. Still, the worker was not able to join the cluster. So, how can I reslove

UPDATE-1

Uninstalled & removed config files and then install docker 1.12 again with version Docker version 1.12.0, build 8eab29e.

Still facing the same problem(Not able to join and "Swarm:Pending" in docker info) with DIFFERENT error in /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.

解决方案

The thing is, I was trying to join with wrong "port" (As docker swarm init shown in output).

1) Before "docker swarm init", the docker running on port "4243" only. I have checked with netstat -tulp | grep docker. So I advertised with that port!

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, the docker is running with 4 port including the port 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

In point 1, it is telling to run docker swarm join with port 4243 in worker. Previously I did run like that!.(It wont work!)

Later I did docker swarm leave and joined with port 2377. Now I am able to join!

docker swarm join --token SWMTKN-1-5j9mpo8hepue6g1sjdas33thr92w1o9hlef5auwqpbxs3glt39-6zomhgu204m9alq51f632nzas 172.25.30.2:2377

这篇关于Docker1.12工人无法加入群集(Swarm:Pending)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆