Initialize Docker Swarm in CentOS (Error response from daemon: rpc error: code = Unavailable desc = grpc: the connection is unavailable)
- siwy
- lip, 09, 2018
- CentOS, Docker
- No Comments
Source:
1. Initializing Docker Swarm on 1 node:
sudo docker swarm init --advertise-addr 192.168.0.1
2. Try add the worker on 2 node:
sudo docker swarm join --token SWMTKN-1-3b33jjwsqpkcy2c8og73aorjf2ao9sjm4crvbwg3xpd1ome459-ckfdcxqqahb9gy9s2t9n5mi78 192.168.0.1:2377
I have error:Error response from daemon: rpc error: code = Unavailable desc = grpc: the connection is unavailable
3. Solution:
Open ports in firewalld in all nodes:
sudo firewall-cmd --add-port=2376/tcp --permanent
sudo firewall-cmd --add-port=2377/tcp --permanent
sudo firewall-cmd --add-port=7946/tcp --permanent
sudo firewall-cmd --add-port=7946/udp --permanent
sudo firewall-cmd --add-port=4789/udp --permanent
In my case I reset nodes, but maybe reset or reload firewalld do this the same.