GRPC: The Connection is unavailable

Hi,

I am completely new to docker. I am going through the getting started guide. I am in middle of part 4. https://docs.docker.com/get-started/part4/#deploy-your-app-on-a-cluster

I am trying to set up a cluster on two VMs. I started one machine and created the swarm.

This is what I see on the first machine:

docker@myvm1:~$ docker swarm join-token worker
To add a worker to this swarm, run the following command:

    docker swarm join \
    --token SWMTKN-1-047oa7i1qj7i8xm2j8a2pou8r6ybilpzn5ocq1j7v9f5vim3ww-2ahix0btoe8gi65pcm040zd12 \
    192.168.99.100:2337

This is what I see on the second machine:

docker@myvm2:~$ docker swarm join \
>     --token SWMTKN-1-047oa7i1qj7i8xm2j8a2pou8r
6ybilpzn5ocq1j7v9f5vim3ww-2ahix0btoe8gi65pcm040z
d12 \
>     192.168.99.100:2337
Error response from daemon: rpc error: code = 14 desc = grpc: the connection is unavailable

How do I get the second machine to join as a worker?

1 Like

Hi I am having same problem. some one please helo us out. I am new in docker. just want to know how to to add a new node (worker machine) in existing swarm.

$ docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
lbeyzsn9718kj5k5c5k6yb4sp * default Ready Active Leader

$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default * virtualbox Running tcp://192.168.99.100:2376 v1 7.07.0-ce
myvm1 - virtualbox Running tcp://192.168.99.101:2376 v1 7.06.2-ce
myvm2 - virtualbox Running tcp://192.168.99.102:2376 v1 7.06.2-ce

while running my commnad of join swarn I am getting following error.

Error :1
Abhishek@Abhishek-PC MINGW64 ~
$ docker swarm join --token SWMTKN-1-2yck6k4sqjazdngelbf8f9un4n6flec0yvx78low3q
8k2qftcc-9rn1u5tk2oh5f46bnpypewuky 192.168.99.100:2377
Error response from daemon: rpc error: code = Unavailable desc = grpc: the conne
ction is unavailable

Error:2 (when adding default vertual box as worker )

Abhishek@Abhishek-PC MINGW64 ~
$ docker-machine ssh myvm1 "docker swarm init --advertise-addr 192.168.99.101"
Swarm initialized: current node (w91yime5rw3g4le0jet9hjh6q) is now a manager.

To add a worker to this swarm, run the following command:

docker swarm join --token SWMTKN-1-4ix7bs8by7hmnz0pc5d6huoelhc2etaum55pozlzi

gqhc4xhxc-212d98lit8azq84sttum865ka 192.168.99.101:2377

To add a manager to this swarm, run ‘docker swarm join-token manager’ and follow
the instructions.

Hi All, I have resolved my issue. This was bit tricky and needed some hit and trial effort.

@person93 - solution for your problem is given below .

docker swarm join --advertise-addr \ --token SWMTKN-1-047oa7i1qj7i8xm2j8a2pou8r6ybilpzn5ocq1j7v9f5vim3ww-2ahix0btoe8gi65pcm040zd12 \ 192.168.99.100:2337

or

docker swarm join --advertise-addr \ --token SWMTKN-1-047oa7i1qj7i8xm2j8a2pou8r6ybilpzn5ocq1j7v9f5vim3ww-2ahix0btoe8gi65pcm040zd12 \ 192.168.99.100:2337

Hi if above command will not work for you then try below one this will help you out for sure.

docker-machine (you want to add as a new node) ssh myvm1 “docker swarm join --token (token number ip:port)”

please let me know if still you have some problem .

I actually have the same issue, but only if I try to connect to a docker machine that I built myself rather than something that I had assembled in Vagrant.

I think my main problem was the error message

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

What connection is unavailable? Is the saying that it cannot connect to the remote server or is it something else? Which port is it connecting to?

I am guessing it cannot connect to port 2377, but here’s the weird part

[root@manager1 ~]# nc -v 192.168.1.113 2377
Ncat: Version 6.40 ( http://nmap.org/ncat )
Ncat: No route to host.
[root@manager1 ~]# nc -v 192.168.1.113 2376
Ncat: Version 6.40 ( http://nmap.org/ncat )
Ncat: Connected to 192.168.1.113:2376.

Why is it no route to host only for 2377?