Failure to connect node to docker

I have two servers in Docker Swarm, but when I need to add a third server, I get the result:

Error response from daemon: rpc error: code = 14 desc = grpc: connection not available

All servers are on the same network.

What could be the problem?

+3


source to share


7 replies


I would say it has to do with the firewall. Make sure your ports are configured correctly in the third field. From Docker Docs :



Open protocols and ports between hosts. The following ports must be accessible. On some systems, these ports are open by default.

TCP port 2377 for communication with cluster management TCP and UDP port 7946 for communication between nodes UDP port 4789 for overlay network traffic

+2


source


From the official Docker swarm

The following ports should be open on your docker servers.

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

      



To enable these ports, run the below command on all of your docker servers. kindly follow digitalocen article for full steps.

firewall-cmd --add-port=2376/tcp --permanent
firewall-cmd --add-port=2377/tcp --permanent
firewall-cmd --add-port=7946/tcp --permanent
firewall-cmd --add-port=7946/udp --permanent
firewall-cmd --add-port=4789/udp --permanent

      

+2


source


As others have pointed out, closed ports may be one of the reasons. But I also found a couple more.

The latest version of Docker suffers from huge proxy issues:

According to this comment , the fix will "probably" turn it into a Docker version 17.11

, and it is "considered" to be fixed for 17.09

.

All my ports are open and the NO_PROXY

hack in the above links is not working.

I have tried all versions of Docker between 17.05

all the way up to 17.11.0-ce-rc3, build 5b4af4f

without any success, which led me to suspect that a recent Vagrant update (I am using 2.0.1

) and / or VirtualBox (using 5.1.30

) might be the culprit . Updating one of these two usually results in any random issues. But instead of downgrading these guys, I tried to update the Vagrant boxes I was running.

In my 2 machine installation, I switched the first node to fso/artful64-desktop

and the second node to fso/artful64

(both versions 2017-11-01

). To my surprise, this made Docker Swarm work on version 17.10.0-ce

and 17.11.0-ce-rc3, build 5b4af4f

. Please note the private network is broken on Vagrant 2.0.1

if you want to use Ubuntu 17.10 box lol (can be manually fixed ).

+1


source


simpler than one of the official docs :

  • restart the swarm manager:

    • clear the swarm with docker swarm leave --force

    • re-init with docker swarm init --advertise-addr [ip of the machine, check it with 'docker-machine ls']:2377

      ( 2377

      is port for swarm pooling )
  • then add the car to the swarm with docker-machine ssh myvm2 "docker swarm join \ --token <token> \ <ip>:<port>"

0


source


The error message we ran into was not exactly the same, but very similar:

Error response from daemon: rpc error: code = Unavailable desc = grpc: connection unavailable

In our case, we added proxy settings for the docker daemon to get the docker node images from behind our corporate proxy. So when trying to connect to docker, join the worker manager, it went to the proxy instead.

Solution: Add swarm manager to NO_PROXY docker daemon environment variable and you're good to go. This answer tells you how.

0


source


Temporarily solved by flushing iptables , but that was a bad idea! After that, cloning the images didn't work because it didn't find a suitable docker iptables.

This is really a FW problem, but more precisely firewalld (centos7).
Solved the issue by allowing the appropriate ports via firewalld as stated by
@ sanjaykumar81's answer.

0


source


More information on this is available in the Docker Forum.

https://forums.docker.com/t/error-response-from-daemon-rpc-error-code-unavailable-desc-grpc-the-connection-is-unavailable/39066

As other people have noted, adding an extra port to firewalld fixes the problem

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

      

0


source







All Articles