0

I just started learning docker, I am facing below challenge, please let me know where I am doing wrong.

My use case: Set up docker swarm manager and add worker node to it.

Step1: To create docker manager, I used below command:

docker swarm init --advertise-addr <<ip_address>> 

Step 2: Run below command, which gives you docker command to add worker.

docker swarm join-token worker

After running above command, I got output as:

docker swarm join --token SWMTKN-1-653srs28a6s48dqxnak9g9kic2cd1xyeowgnke53nf83710wfv-7u7u7u1vovahvn792814q2sts ip_address:2377

Step3: I logged-in to worker node and ran above docker swarm join command. But I am getting below error message.

Error response from daemon: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection er ror: desc = "transport: Error while dialing dial tcp ip_address:2377: connect: connection refused"

Rakesh
  • 1,374
  • 1
  • 16
  • 24

1 Answers1

2

This could well be a firewall issue, make sure you have port 2377, 7946 & 4789 in open state between the hosts acting as manager or worker node -

From the docs -

Open protocols and ports between the hosts The following ports must be available.

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

vivekyad4v
  • 13,321
  • 4
  • 55
  • 63
  • I'm still having this issue. Using two MacBook pros, with firewall disabled on both, trying this over wifi. I can start a service on one Mac and access it from the other (say, a simple webserver). I can ssh into the one computer from the other (and vice versa) just fine. Only thing that doesn't seem to work is the docket swarm join command. Ideas or suggestions? – rodrigo-silveira Oct 01 '19 at 01:05
  • 2
    https://docs.docker.com/engine/swarm/swarm-tutorial/. "Currently, you cannot use Docker Desktop for Mac or Docker Desktop for Windows alone to test a multi-node swarm". Alternatively you could create Swarm with a Linux manager + Mac (or Windows) workers: https://stackoverflow.com/a/69058087/7991646 – jrbe228 Sep 04 '21 at 23:55