Target: Creating a Docker Swarm
Condition:
Operation:
docker swarm init
docker swarm join --token SWMTKN-1-3o2m78qf57hy2zikfx8p2yc7hrn63edlmlixwrq7bh28xws7zx-9oirn0wh3mbrdui3kcwytl560 192.168.65.9:2377
Error:
Error response from daemon: rpc error: code = Unavailable desc = connection error:
desc = "transport: Error while dialing dial tcp 192.168.65.9:2377: connect: no route to host"
What I've done so far:
Asking for help: I saw other people can easily run the "docker swarm join" command in the tutorial. Why I got this problem? Any one can help me out? Really appreciate your help.
You need to connect machines together verify that by ping (if you are using a firewall then ping ICMP packets wont work). do a curl request from A to B
ufw status
if its status: inactive then its not a problem else disable the firewall(DISCLAIMER: may become a security issue) or Open only specific ports like 2376, 4789, 2377, 7946.ufw allow 7946/tcp
ufw allow 7946/udp
ufw allow 2376/tcp
ufw allow 4789/udp
ufw allow 2377/tcp
sudo ufw reload