节点无法加入Swarm群集

编程入门 行业动态 更新时间:2024-10-26 14:29:49
本文介绍了节点无法加入Swarm群集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有3个虚拟机。他们都有docker 1.12,并且都在centos7上运行。 所有端口都打开,并且虚拟机能够ping通彼此我用

I have 3 VM's. They all have docker 1.12 and they are running on centos7. All the ports are opened and the vm's are able to ping eachother I started my cluster with

docker swarm init --advertise-addr 192.168.140.12

Docker信息告诉我:

Docker info showed me:

Swarm: active NodeID: 0drcj2nku1mv8t16fxva48edxx Is Manager: true ClusterID: cchn0yzospwoe1h9f55d7omxx Managers: 1 Nodes: 1

现在我尝试将节点(其他vm)加入集群。我使用启动管理员后推荐的命令。

Now I try to join nodes (other vms) to the cluster. I use the command which was recommended after starting my manager.

docker swarm join \ --token SWMTKN-1-48ythur5k6ckkz90ttlprw37p9z3ldclws51qirw5wdyfmvevr-3sb2t66b2fj6e4dhmfo1vavxx \ 192.168.140.12:2377

But I got:

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.

Docker信息向我显示:

Docker info showed me:

Swarm: pending NodeID: Error: rpc error: code = 1 desc = context canceled Is Manager: false Node Address: 192.168.140.14

在群集管理器上:

# netstat -tulpn | grep docker tcp6 0 0 :::2377 :::* LISTEN 1602/dockerd tcp6 0 0 :::7946 :::* LISTEN 1602/dockerd tcp6 0 0 :::8080 :::* LISTEN 3398/docker-proxy tcp6 0 0 :::32768 :::* LISTEN 3199/docker-proxy tcp6 0 0 :::32769 :::* LISTEN 3219/docker-proxy tcp6 0 0 :::32770 :::* LISTEN 3341/docker-proxy tcp6 0 0 :::32771 :::* LISTEN 3436/docker-proxy tcp6 0 0 :::2375 :::* LISTEN 1602/dockerd udp6 0 0 :::7946 :::* 1602/dockerd

我该如何调试此问题或忘记了p执行一些重要步骤?服务器之间是否需要ssh-access?谢谢

How can I debug this issue or did I forgot to perform some important step? Do the servers need ssh-access to each other? Thanks

在节点上的日志:

Aug 8 09:50:24 localhost dockerd: time="2016-08-08T09:50:24.393432145-04:00" level=error msg="Handler for POST /v1.24/swarm/leave returned error: This node is not part of swarm" Aug 8 09:51:01 localhost su: (to root) worker1 on pts/1 Aug 8 09:51:34 localhost dockerd: time="2016-08-08T09:51:34.384408514-04: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." Aug 8 09:51:40 localhost su: (to root) worker1 on pts/1 Aug 8 09:52:47 localhost dhclient[1277]: DHCPREQUEST on eno16777736 to 192.168.140.254 port 67 (xid=0x11f8fba8) Aug 8 09:52:47 localhost dhclient[1277]: DHCPACK from 192.168.140.254 (xid=0x11f8fba8) Aug 8 09:52:47 localhost NetworkManager[953]: <info> address 192.168.140.13 Aug 8 09:52:47 localhost NetworkManager[953]: <info> plen 24 (255.255.255.0) Aug 8 09:52:47 localhost NetworkManager[953]: <info> gateway 192.168.140.2 Aug 8 09:52:47 localhost NetworkManager[953]: <info> server identifier 192.168.140.254 Aug 8 09:52:47 localhost NetworkManager[953]: <info> lease time 1800 Aug 8 09:52:47 localhost NetworkManager[953]: <info> nameserver '192.168.140.2' Aug 8 09:52:47 localhost NetworkManager[953]: <info> domain name 'localdomain' Aug 8 09:52:47 localhost NetworkManager[953]: <info> (eno16777736): DHCPv4 state changed bound -> bound Aug 8 09:52:47 localhost dbus[878]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' Aug 8 09:52:47 localhost dbus-daemon: dbus[878]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' Aug 8 09:52:47 localhost systemd: Starting Network Manager Script Dispatcher Service... Aug 8 09:52:47 localhost dhclient[1277]: bound to 192.168.140.13 -- renewal in 713 seconds. Aug 8 09:52:47 localhost dbus[878]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher' Aug 8 09:52:47 localhost dbus-daemon: dbus[878]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher' Aug 8 09:52:47 localhost nm-dispatcher: Dispatching action 'dhcp4-change' for eno16777736 Aug 8 09:52:47 localhost systemd: Started Network Manager Script Dispatcher Service.

有时会警告:

level=warning msg="failed to retrieve remote root CA certificate: rpc error: code = 1 desc = context canceled

推荐答案

也许您正在使用http代理。

Maybe you were using a http proxy.

您可以使用以下命令查看

You can use the following command to see what dockerd is doing.

# strace -Fp `pidof dockerd` 2>&1 |grep -v futex |grep -v epoll_wait |grep -v pselect

更多推荐

节点无法加入Swarm群集

本文发布于:2023-11-25 15:50:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1630368.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:节点   Swarm

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!