gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 17:58:09 25 4
gpt4 key购买 nike

管理器版本 Docker version 1.12.0-rc5, build a3f2063 ,

worker 版本 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

然后创建 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.

我已经检查了 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."

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

我做了 docker swarm 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."

谢谢。

最佳答案

问题是,我试图加入错误的“端口”(如 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) 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在 worker 。以前我确实是这样跑的!.(这是行不通的!)

后来我做了 docker swarm leave并加入端口 2377 .现在我可以加入了!
docker swarm join --token SWMTKN-1-5j9mpo8hepue6g1sjdas33thr92w1o9hlef5auwqpbxs3glt39-6zomhgu204m9alq51f632nzas 172.25.30.2:2377

关于Docker1.12 Worker 无法加入集群(Swarm : Pending),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38693560/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com