問題:docker ---- It's possible that too few managers are online. Make sure more than half of the managers are online. node
背景:docker測試集羣,爲3臺虛擬機,鏡像所有拷貝自其它docker 虛擬機。 因爲原先安裝過swarm,先通過拷貝重啓後在執行 dowker swarm XX 時報錯。docker
解決:測試
1.每臺先強制init :this
docker swarm init --force-new-cluster (此時執行 docker node ls --將node信息刪除,緣由是這些node所有來自我拷貝的鏡像中老舊的信息。)token
2.而後此時選取 swarm worker節點加入到其中一臺時:docker swarm join --token **** ip
報錯Error response from daemon: This node is already part of a swarm. Use "docker swarm leave" to leave this swarm and join another one.ci
3.根據提示須要 docker swarm leave ,而後報錯:虛擬機
Error response from daemon: You are attempting to leave the swarm on a node that is participating as a manager. Removing the last manager erases all current state of the swarm. Use `--force` to ignore this message.it
4.根據提示:加上--force : docker swarm leave --force 而後再從新join便可io
附:Server Version: 17.12.1-ce