1

Consider the following setup:

Three hosts in the same network:

  • Host A - SLES
  • Host B - Ubuntu
  • Host C - Ubuntu

Then, the following has worked:

  • Init swarm on A
  • Join swarm at B, make B a manager

The following is however not working:

  • Join swarm at C as worker with token issued from A
  • Join swarm at C as worker with token issued from B

In both cases we get the same error:

Error response from daemon: could not find local IP address: 
dial udp: address udp/2377​: unknown port

Honestly, I have even no idea how to interpret this message.

Any ideas?..

UPD. nmap results for ports 2377,4789,7946 (hint from Felipe in a comment below) - no idea what are they good for but now it is clear that something is wrong with host C.

Host A (Primary manager)

PORT     STATE  SERVICE
2377/tcp open   unknown
4789/tcp closed unknown
7946/tcp open   unknown

Host B (Secondary manager)

PORT     STATE  SERVICE
2377/tcp open   unknown
4789/tcp closed unknown
7946/tcp open   unknown

Host C (should become a worker)

PORT     STATE  SERVICE
2377/tcp closed unknown
4789/tcp closed unknown
7946/tcp closed unknown

Host D (successfully added as a worker)

PORT     STATE  SERVICE
2377/tcp closed unknown
4789/tcp closed unknown
7946/tcp open   unknown

Finally, with host B there is the actual problem.

  • swarm init => OK; port 2377 is open
  • swarm leave => port is closed again
  • swarm join => error "port not found"
  • UPD github.com/moby/moby/issues/34794 – Peter Sep 9 '17 at 7:11
  • Maybe if you share the commands you have used, like - (...) docker swarm init --advertise-addr x.x.x.x (...) - (...) docker swarm join (...) We might have a clue. Maybe the ports configurations for host C are wrong ? – Felipe de Macêdo Sep 11 '17 at 12:42
  • the command is exactly same copy-paste which is issued by docker itself on "docker swarm join-token worker" – Peter Sep 11 '17 at 17:37
  • @Peter did you find a solution? – user3731622 Apr 19 at 20:49
1

Could you please try the commands above between all hosts ?

INSIDE HOST A:

nc -zv HOST_B_IP_ADDRESS 2377,4789,7946
nc -zv HOST_C_IP_ADDRESS 2377,4789,7946

INSIDE HOST B:

nc -zv HOST_A_IP_ADDRESS 2377,4789,7946
nc -zv HOST_C_IP_ADDRESS 2377,4789,7946

INSIDE HOST C:

nc -zv HOST_A_IP_ADDRESS 2377,4789,7946
nc -zv HOST_B_IP_ADDRESS 2377,4789,7946

As explained in https://docs.docker.com/engine/swarm/swarm-tutorial/#open-protocols-and-ports-between-the-hosts, some ports must be available between hosts in order for Docker Swarm to work correctly.

The error reported sounds like a port related problem. Maybe is there another application in one of these hosts already using one of the ports needed by Docker ? Maybe a firewall configuration ?

  • So your command says "invalid port" so I tried nmap with these ports - see update above. – Peter Sep 13 '17 at 9:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.