Docker Community Forums

Share and learn in the Docker community.

Swarm don't add a managers


(Ampopov) #1

Hello.

I create swarm with docker swarm init. Then I and 3 worker with generated docker swarm join …
My swarm cluster look like that:
xsip-docker1 - manager (swarm init node)
xsip-docker2 - worker
xsip-docker3 - worker
xsip-docker4 - worker

After that I try extend 1 worker to manager with docker node promote xsip-docker3. xsip-docker3 switch to manager in docker node inspect xsip-docker3, but in docker node ls manager status don’t displayed. After reboot xsip-worker3 node go down in manager and don’t go active newer.
In xsip-worker3 logs I see:

Mar 13 12:09:23 xsip-docker3 dockerd: time=“2018-03-13T12:09:23.381312467-04:00” level=info msg=“Listening for connections” addr="[::]:2377" module=node node.id=5pfs5bm16e557kkunxq471980 proto=tcp
Mar 13 12:09:23 xsip-docker3 dockerd: time=“2018-03-13T12:09:23.381637981-04:00” level=info msg=“Listening for local connections” addr=/var/run/docker/swarm/control.sock module=node node.id=5pfs5bm16e557kkunxq471980 proto=unix
Mar 13 12:09:34 xsip-docker3 dockerd: time=“2018-03-13T12:09:34.382157631-04:00” level=info msg=“Stopping manager” module=node node.id=5pfs5bm16e557kkunxq471980
Mar 13 12:09:34 xsip-docker3 dockerd: time=“2018-03-13T12:09:34.382353714-04:00” level=info msg=“Manager shut down” module=node node.id=5pfs5bm16e557kkunxq471980
Mar 13 12:09:34 xsip-docker3 dockerd: time=“2018-03-13T12:09:34.382402113-04:00” level=info msg=“shutting down certificate renewal routine” module=node/tls node.id=5pfs5bm16e557kkunxq471980 node.role=swarm-manager
Mar 13 12:09:34 xsip-docker3 dockerd: time=“2018-03-13T12:09:34.382868401-04:00” level=error msg="cluster exited with error: manager stopped: can’t initialize raft node: rpc error: code = DeadlineExceeded desc = context deadline exceeded"
Mar 13 12:09:34 xsip-docker3 dockerd: time=“2018-03-13T12:09:34.383738983-04:00” level=error msg=“Handler for POST /v1.35/swarm/join returned error: manager stopped: can’t initialize raft node: rpc error: code = DeadlineExceeded desc = context deadline exceeded”

If I leave the cluster and then join back as worker all work fine. What I do wrong? How I can create second manager?

My docker info:

Containers: 4
Running: 2
Paused: 0
Stopped: 2
Images: 15
Server Version: 17.12.1-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: active
NodeID: kj1huxpr6dwvlq3w9vkssu1n4
Is Manager: false
Node Address: 172.21.41.10
Manager Addresses:
172.21.41.14:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9b55aab90508bd389d7654c4baf173a981477d55
runc version: 9f9c96235cc97674e935002fc3d78361b696a69e
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.0-693.el7.x86_64
Operating System: Red Hat Enterprise Linux Server 7.4 (Maipo)
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.639GiB
Name: xsip-docker3
ID: UCOO:JGXS:VJRI:ZN7E:TWY6:Q4VH:UCO6:SEDL:S2KU:MX4K:FUUK:FSV2
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
HTTP Proxy: h t t p : // 127.0.0.1:3128/
HTTPS Proxy: h t t p : // 127.0.0.1:3128/
Registry: h t t p s : // index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

My iptables rules:

-A IN_public_allow -p tcp -m tcp --dport 2376 -m conntrack --ctstate NEW -j ACCEPT
-A IN_public_allow -p tcp -m tcp --dport 7946 -m conntrack --ctstate NEW -j ACCEPT
-A IN_public_allow -p udp -m udp --dport 7946 -m conntrack --ctstate NEW -j ACCEPT
-A IN_public_allow -p udp -m udp --dport 4789 -m conntrack --ctstate NEW -j ACCEPT
-A IN_public_allow -p tcp -m tcp --dport 2377 -m conntrack --ctstate NEW -j ACCEPT
-A IN_public_allow -p tcp -m tcp --dport 2375 -m conntrack --ctstate NEW -j ACCEPT


(Ampopov) #2

I think this is some bug. I install clean RHEL7.4, add only 1 network, create cluster with 4 managers, then add another networks. All work fine. Thank’s all.