github.com/vieux/docker@v0.6.3-0.20161004191708-e097c2a938c7/docs/reference/commandline/swarm_leave.md (about) 1 <!--[metadata]> 2 +++ 3 title = "swarm leave" 4 description = "The swarm leave command description and usage" 5 keywords = ["swarm, leave"] 6 [menu.main] 7 parent = "smn_cli" 8 +++ 9 <![end-metadata]--> 10 11 # swarm leave 12 13 ```markdown 14 Usage: docker swarm leave [OPTIONS] 15 16 Leave the swarm (workers only). 17 18 Options: 19 --force Force this node to leave the swarm, ignoring warnings 20 --help Print usage 21 ``` 22 23 When you run this command on a worker, that worker leaves the swarm. 24 25 You can use the `--force` option to on a manager to remove it from the swarm. 26 However, this does not reconfigure the swarm to ensure that there are enough 27 managers to maintain a quorum in the swarm. The safe way to remove a manager 28 from a swarm is to demote it to a worker and then direct it to leave the quorum 29 without using `--force`. Only use `--force` in situations where the swarm will 30 no longer be used after the manager leaves, such as in a single-node swarm. 31 32 Consider the following swarm, as seen from the manager: 33 ```bash 34 $ docker node ls 35 ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS 36 7ln70fl22uw2dvjn2ft53m3q5 worker2 Ready Active 37 dkp8vy1dq1kxleu9g4u78tlag worker1 Ready Active 38 dvfxp4zseq4s0rih1selh0d20 * manager1 Ready Active Leader 39 ``` 40 41 To remove `worker2`, issue the following command from `worker2` itself: 42 ```bash 43 $ docker swarm leave 44 Node left the default swarm. 45 ``` 46 To remove an inactive node, use the [`node rm`](node_rm.md) command instead. 47 48 ## Related information 49 50 * [node rm](node_rm.md) 51 * [swarm init](swarm_init.md) 52 * [swarm join](swarm_join.md) 53 * [swarm update](swarm_update.md)