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 in Docker by Hamza
• 180 points

recategorized Feb 4 by Vardhan 493 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
• 6,880 points
100 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
• 41,990 points
64 views
+3 votes
3 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 in Docker by Vaidya
4,626 views
0 votes
1 answer
0 votes
1 answer

Docker unable to connect AWS EC2 cloud

Your command is not pointing to your ...READ MORE

answered Jul 16, 2018 in Docker by Kalgi
• 41,990 points
81 views
0 votes
1 answer

Docker can't connect to docker daemon

The Post-installation steps for Linux documentation reveals the following ...READ MORE

answered Jul 18, 2018 in Docker by Kalgi
• 2,620 points
65 views
0 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
1,032 views