Worker cannot connect to docker swarm manager

0 votes

I have setup the docker swarm manager in one machine with IP 192.168.XXX.XXX by using this command :

docker swarm init --advertise-addr=192.168.XXX.XXX and I got this message :

To add a worker to this swarm, run the following command:

docker swarm join --token SWMTKN-1- 
0jpgak7bm7t4mzluz48gdub06f5036q8yaoo99awkjmlz48vtb- 
1eutz0k1vp37ztmiuxdnglka2 192.168.XXX.XXX:2377

To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
In other machine I tried the following command :
docker swarm join --token SWMTKN-1- 
0jpgak7bm7t4mzluz48gdub06f5036q8yaoo99awkjmlz48vtb- 
1eutz0k1vp37ztmiuxdnglka2 192.168.XXX.XXX:2377
and the result was :
error response from daemon : rpc error : code = Unavailable desc = all 
SubConns are in TransientFailure, latest connection error: connection error 
: desc = "transport: Error while dialing dial tcp 192.168.XXX.XXX:2377 : 
connect: connection refused

Docker version :

Client: Docker Engine - Community
 Version:           18.09.0
 API version:       1.39
 Go version:        go1.10.4
 Git commit:        4d60db4
 Built:             Wed Nov  7 00:47:51 2018
 OS/Arch:           windows/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.0
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.4
  Git commit:       4d60db4
  Built:            Wed Nov  7 00:55:00 2018
  OS/Arch:          linux/amd64
  Experimental:     false
I also tried to provide my machine ip 192.168.XXX.XXX on the listen address in swarm init but I 
got the following error : 
docker swarm init --advertise-addr 192.168.XXX.XXX --listen-addr 192.168.XXX.XXX
Error response from daemon: manager stopped: failed to listen on remote API address: listen tcp 192.168.XXX.XXX: bind: cannot assign requested address

Jan 25, 2019 in Docker by Hamza
• 200 points

recategorized Feb 4, 2019 by Vardhan 4,143 views
Didn't work :(
The easiest way out is, check what all ports are open/available and use those ports with --advertise-addr.
Hi @Hamza,

you need to establish the connection through ssh first

then only worker can join manage
Hi @Kalgl
I somehow managed to setup the swarm cluster now I have one manager and one worker
Now I am trying to create an overlay network to connect two containers  i.e Spark Master in manager node and Spark Worker in worker node.
Steps :
1. Made the overlay network in manager i.e docker create network --driver=overlay --attachable my-network
2. Then added these lines in docker-compose of Spark Master :
     networks:
           - my-network
networks:
     my-network:
          external : true
3. Then I ran the command docker-compose up in manager and the service started successfully
4 But when I added the above lines in the docker-compose of Spark-worker in worker node then It couldn't start
by saying that "Could not found external network my-network"
Can you please guide me what am I doing wrong?

Inspect your network to check for any running contains. 

network inspect my-network

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Docker

0 votes
1 answer

swarm manager does not connect to nodes docker daemons on AWS

You first need to ssh into the ...READ MORE

answered Aug 24, 2018 in Docker by Nilesh
• 7,050 points
1,438 views
+2 votes
1 answer

Cannot connect to docker swarm service task

The id that command docker service ps <service> gives ...READ MORE

answered Sep 26, 2018 in Docker by Kalgi
• 52,360 points
1,307 views
+3 votes
4 answers

Not able to connect worker nodes to the swarm. Connection refused error

This definitely has to be a firewall issue. ...READ MORE

answered Apr 26, 2019 in Docker by Vaidya
18,035 views
+1 vote
1 answer

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Hi@akhtar, It seems the docker service is not ...READ MORE

answered Dec 24, 2020 in Docker by MD
• 95,440 points
15,210 views
0 votes
1 answer

How to add one worker node to the Docker swarm?

Hi@akhtar, You will get one token when you ...READ MORE

answered Dec 24, 2020 in Docker by MD
• 95,440 points
933 views
+2 votes
1 answer
+5 votes
7 answers

Docker swarm vs kubernetes

Swarm is easy handling while kn8 is ...READ MORE

answered Aug 27, 2018 in Docker by Mahesh Ajmeria
3,139 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP