Docker Community Forums

Share and learn in the Docker community.

Fail join node as Worker


(J4vier) #1

Hello everyone, I am trying to form a Docker Swarm with a manager node and 2 workers. The problem is that the worker nodes do not join the swarm, and they show me the following error:

docker swarm join \

--token SWMTKN-1-40dp45dybgfah9wcunovtz9vy4dorbv3migjf45hrf8fu4w50l-72ild9aigjadqtsz0s159qbj7 \
192.168.15.61:2377

Error response from daemon: Timeout was reached before node was joined. The attempt to join the swarm will continue in the background. Use the “docker info” command to see the current swarm status of your node.

docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 5
Server Version: 17.05.0-ce
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 23
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Swarm: error
NodeID:
Error: rpc error: code = 4 desc = context deadline exceeded
Is Manager: false
Node Address: 192.168.15.62
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9048e5e50717ea4497b757314bad98ea3763c145
runc version: 9c2d8d184e5da67c95d601382adf14862e4f2228
init version: 949e6fa
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.4.0-103-generic
Operating System: Ubuntu 16.04.3 LTS
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 5.828GiB
Name: node-2
ID: MJ6T:7H5D:D75I:2MBD:55WM:RNZS:7GXS:VZ3H:VK2C:TUAV:IGED:RBBQ
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Username: j4vier
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

In logs, i can see this:

Mar 23 06:13:15 localhost dockerd[30120]: time=“2018-03-23T06:13:15.955019189Z” level=error msg=“failed to retrieve remote root CA certificate” error=“rpc error: code = 4 desc = context deadline exceeded” module=node
Mar 23 06:13:20 localhost dockerd[30120]: time=“2018-03-23T06:13:20.955462686Z” level=error msg=“failed to retrieve remote root CA certificate” error=“rpc error: code = 4 desc = context deadline exceeded” module=node
Mar 23 06:13:25 localhost dockerd[30120]: time=“2018-03-23T06:13:25.956006091Z” level=error msg=“failed to retrieve remote root CA certificate” error=“rpc error: code = 4 desc = context deadline exceeded” module=node
Mar 23 06:13:30 localhost dockerd[30120]: time=“2018-03-23T06:13:30.957090086Z” level=error msg=“failed to retrieve remote root CA certificate” error=“rpc error: code = 4 desc = context deadline exceeded” module=node
Mar 23 06:13:31 localhost dockerd[30120]: time=“2018-03-23T06:13:31.034087808Z” level=error msg=“Handler for POST /v1.29/swarm/join returned error: Timeout was reached before node was joined. The attempt to join the swarm will continue in the background. Use the “docker info” command to see the current swarm status of your node.”
Mar 23 06:13:35 localhost dockerd[30120]: time=“2018-03-23T06:13:35.958060130Z” level=error msg=“failed to retrieve remote root CA certificate” error=“rpc error: code = 4 desc = context deadline exceeded” module=node
Mar 23 06:13:35 localhost dockerd[30120]: time=“2018-03-23T06:13:35.959574057Z” level=error msg=“cluster exited with error: rpc error: code = 4 desc = context deadline exceeded”


(King Chung Huang) #2

You need to ensure that the requisite network ports are open between the swarm nodes.

  • TCP port 2377 for cluster management communications
  • TCP and UDP port 7946 for communication among nodes
  • UDP port 4789 for overlay network traffic

See Open protocols and ports between the hosts.

Also, Docker 17.05.0 is pretty old. You should consider installing something more recent.


(J4vier) #3

Thanks for repply.

sysadmin@ubuntu-1:~$ sudo netstat -tulp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 :ssh : LISTEN 1246/sshd
tcp 0 0 :24007 : LISTEN 22229/glusterd
tcp 0 0 :sunrpc : LISTEN 22380/rpcbind
tcp6 0 0 [::]:ssh [::]:
LISTEN 1246/sshd
tcp6 0 0 [::]:2377 [::]:
LISTEN 14117/dockerd
tcp6 0 0 [::]:7946 [::]:
LISTEN 14117/dockerd
tcp6 0 0 [::]:sunrpc [::]:* LISTEN 22380/rpcbind
udp 0 0 :4789 : -
udp 0 0 :932 : 22380/rpcbind
udp 0 0 :sunrpc : 22380/rpcbind
udp6 0 0 [::]:932 [::]:
22380/rpcbind
udp6 0 0 [::]:7946 [::]:
14117/dockerd
udp6 0 0 [::]:sunrpc [::]:
22380/rpcbind

I have this ports opens, but the problems continue…


(Debuggermalhotra) #4

Hi! DId you figure out what was the issue? I am facing the same issue!