docker swarm join connection error from other instance and local pc

3.9k Views Asked by At

I gave role like this.

env: oracle cloud. open port: TCP 2377 , UDP TCP 7946 ,UDP 4786

Instance A : manager Instance B : worker Local PC : worker

init swarm mode with this cli on A

docker swarm init  --advertise-addr <A's IP>

B got

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 A's IP:2377: connect: no route to host"

Local PC got

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 A's IP:2377: connect: connection refused"

well I have no idea what should I need to do more.

thank you in advance.

3

There are 3 best solutions below

1
On

the problem was firewall setting on manager node's instance.

sudo firewall-cmd --add-port=2377/tcp --permanent
sudo firewall-cmd --reload
0
On

Check the network connectivity between A and B, seems like they are not on the same network.

1
On

for me @Logan Lee solution perfectly matched.

According to the docker documentation, following ports need to manage accordingly

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

Thanks @Logan Lee