【Docker】Error response from daemon: rpc error: code = Unavailable

  • Post author:
  • Post category:其他


1、问题如下:

创建完docker swarm将myvm3 node主机加入swarm中,执行以下命令时:

#root@zzw-C6100:/var/lib/docker/service-zzw# docker-machine ssh myvm3 "docker swarm join --token SWMTKN-1-2wutdtn22qqhl53wizuo4oavlmnwc9jhg1kxpzbxm2jeele44b-6fwtiplwvemsdmiflqllumufk 192.168.99.102:2377"

报错如下:



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 192.168.99.102:2377: connect: connection refused”

2、错误原因:

错误原因是如下的





docker swarm join

命令中的





ip

地址应该为 swarm manager 节点的ip地址与端口;

$ docker-machine ssh myvm2 "docker swarm join --token <token> <ip>:2377

3、解决方法:

修改swarm join命令如下即可:

#root@zzw-C6100:/var/lib/docker/service-zzw# docker-machine --native-ssh ssh myvm3 "docker swarm join --token SWMTKN-1-2wutdtn22qqhl53wizuo4oavlmnwc9jhg1kxpzbxm2jeele44b-6fwtiplwvemsdmiflqllumufk 192.168.99.100:2377"



版权声明:本文为qq_34018840原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。