2016-06-13 22:57:19 -04:00
|
|
|
<!--[metadata]>
|
|
|
|
+++
|
|
|
|
title = "swarm leave"
|
|
|
|
description = "The swarm leave command description and usage"
|
|
|
|
keywords = ["swarm, leave"]
|
|
|
|
[menu.main]
|
|
|
|
parent = "smn_cli"
|
|
|
|
+++
|
|
|
|
<![end-metadata]-->
|
|
|
|
|
|
|
|
# swarm leave
|
|
|
|
|
2016-07-07 14:43:18 -04:00
|
|
|
```markdown
|
|
|
|
Usage: docker swarm leave [OPTIONS]
|
2016-06-13 22:57:19 -04:00
|
|
|
|
2016-07-20 14:15:08 -04:00
|
|
|
Leave a swarm
|
2016-06-13 22:57:19 -04:00
|
|
|
|
2016-07-07 14:43:18 -04:00
|
|
|
Options:
|
|
|
|
--force Force leave ignoring warnings.
|
|
|
|
--help Print usage
|
|
|
|
```
|
2016-06-13 22:57:19 -04:00
|
|
|
|
|
|
|
This command causes the node to leave the swarm.
|
|
|
|
|
|
|
|
On a manager node:
|
|
|
|
```bash
|
|
|
|
$ docker node ls
|
2016-07-20 14:15:08 -04:00
|
|
|
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
|
|
|
|
7ln70fl22uw2dvjn2ft53m3q5 worker2 Ready Active
|
|
|
|
dkp8vy1dq1kxleu9g4u78tlag worker1 Ready Active Reachable
|
|
|
|
dvfxp4zseq4s0rih1selh0d20 * manager1 Ready Active Leader
|
2016-06-13 22:57:19 -04:00
|
|
|
```
|
|
|
|
|
2016-08-17 03:59:51 -04:00
|
|
|
On a worker node, worker2 in the following example:
|
2016-06-13 22:57:19 -04:00
|
|
|
```bash
|
|
|
|
$ docker swarm leave
|
|
|
|
Node left the default swarm.
|
|
|
|
```
|
|
|
|
|
|
|
|
On a manager node:
|
|
|
|
```bash
|
|
|
|
$ docker node ls
|
2016-07-20 14:15:08 -04:00
|
|
|
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
|
|
|
|
7ln70fl22uw2dvjn2ft53m3q5 worker2 Down Active
|
|
|
|
dkp8vy1dq1kxleu9g4u78tlag worker1 Ready Active Reachable
|
|
|
|
dvfxp4zseq4s0rih1selh0d20 * manager1 Ready Active Leader
|
2016-06-13 22:57:19 -04:00
|
|
|
```
|
|
|
|
|
|
|
|
## Related information
|
|
|
|
|
|
|
|
* [swarm init](swarm_init.md)
|
|
|
|
* [swarm join](swarm_join.md)
|
|
|
|
* [swarm update](swarm_update.md)
|