Docker Community Forums

Share and learn in the Docker community.

Swarm on five physical servers - Not seeing any node on the master


(Thorsten Michels) #1

Hi there!
I am confused. I try to get swarm up and running, but it keeps failing, well at least I do not see the swarm.
I do have five (physical) servers, CentOS 7 (most updated) and Docker 1.9.1

Dell1950     IP
Dell2950     IP
Little            IP
Master         IP

On every node I ran:

sudo docker daemon -H tcp:// -H unix:///var/run/docker.sock &

and jobs tells, that each docker daemon is running.

[1]+  Running                  sudo docker daemon -H tcp:// -H unix:///var/run/docker.sock &

So far so good.
Then I create a token on the master:

docker run --rm swarm create | tee ~/`whoami`_`date +%Y%m%d_%H%M`_token.txt

Then I prepared the following statement and copied manually in the putty sessions:

node_ip="`ip addr | grep "inet 192" | tr -s ' ' | cut -d' ' -f 3 | cut -d'/' -f1`" &&  \
docker run -d swarm join --addr=$node_ip:2375 token://3173c53388fc57453825d4fdc4c33562
INFO[1385] POST /v1.21/containers/create
INFO[1386] POST /v1.21/containers/a34fe533bf35095c8078abfca13bb62d6ad0bbb927f08825c903f2e968b13542/start

A docker ps -a shows a running container on each server. Great!

Now it comes to the Master.

docker run -d -p 2376:2375 swarm manage token://3173c53388fc57453825d4fdc4c33562

Looks good.

$ docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
fbc1020058d1        swarm               "/swarm manage token:"   16 seconds ago      Up 14 seconds>2375/tcp   boring_noyce

Looks also good.

docker -H tcp:// info
Containers: 0
Images: 0
Role: primary
Strategy: spread
Filters: health, port, dependency, affinity, constraint
Nodes: 0
CPUs: 0
Total Memory: 0 B
Name: fbc1020058d1

This is not exactly what I expected.
And a docker -H tcp:// info will not change anything.

All firewalls are down and netstat always says:

$ netstat -an | grep 2375 
tcp6       0      0 :::2375                 :::*                    LISTEN


$ netstat -an | grep 237
tcp6       0      0 :::2376                 :::*                    LISTEN
unix  3      [ ]         STREAM     VERBUNDEN     22237

deep sigh

Any suggestions? Any hint / tip will be heartly appreciated.

Thank you very much in advance

(Tonykuo) #2

Master should be allowed to access 2375 port to each node.

Telnet node 2375 port from master.

If the connection refused, check firewall or iptables on each node.

(Thorsten Michels) #3

Hi tonykuo!
I just double checked:

  • Firewalls are OFF (defently positive)
  • The daemons are running on all servers. (Master and Slaves)

But then I discovered something wired:
When I do a netstat -an I see the tcp6.
tcp6 != tcp(4).

Maybe this is because I am running on CentOS7?
I am confused.
Any ideas? Anyone?

(Thorsten Michels) #4

To whom ever may read this!
I found out, that in my particular case, the IPv6 protocol was causing the trouble.
I turned it off and anything went smoothly fine.
Please find a howto for your appropiate OS on My favourite search engine (!Google)

This is a great day!

I hope this thread will help someone.