Cannot leave swarm mode

醉酒当歌 提交于 2019-12-13 17:08:17

问题


I've been tinkering with new Docker swarm mode. I can't fully recall the steps that I did, but now I'm stuck in situation where my docker engine is as a worker in a non-existing swarm:

$ docker info
...
Swarm: active
 NodeID: 1vndsuqa0r3paswufs7eq4po3
 Is Manager: false
 Node Address: 192.168.65.2
...

$ docker swarm leave
Error response from daemon: context deadline exceeded

$ docker version
Client:
 Version:      1.12.0
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   8eab29e
 Built:        Thu Jul 28 21:04:48 2016
 OS/Arch:      darwin/amd64
 Experimental: true

Server:
 Version:      1.12.0
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   8eab29e
 Built:        Thu Jul 28 21:04:48 2016
 OS/Arch:      linux/amd64
 Experimental: true

How could I get out the swarm mode?


回答1:


I believe this was a bug in 1.12.0 that has been resolved since (I believe the patch should be included in 1.12.3). Here is the Related Issue.

But if the problem persists with the new version somehow, there are a few additional options:

# Force quit the cluster

docker swarm leave --force

or

# Force a new cluster and leave properly

docker swarm init --force-new-cluster
docker swarm leave



回答2:


I finally managed to fix this by resetting docker back to factory defaults from Docker menu > Preferences > Uninstall / Reset > Reset to factory defaults (I'm using Docker for Mac beta). Note that this operation also swipes all docker images, volumes, networks, etc.



来源:https://stackoverflow.com/questions/38845995/cannot-leave-swarm-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!