2016-06-13 22:57:19 -04:00
|
|
|
<!--[metadata]>
|
|
|
|
+++
|
|
|
|
title = "node rm"
|
|
|
|
description = "The node rm command description and usage"
|
|
|
|
keywords = ["node, remove"]
|
|
|
|
[menu.main]
|
|
|
|
parent = "smn_cli"
|
|
|
|
+++
|
|
|
|
<![end-metadata]-->
|
|
|
|
|
|
|
|
# node rm
|
|
|
|
|
2016-07-07 14:43:18 -04:00
|
|
|
```markdown
|
2016-07-28 00:17:00 -04:00
|
|
|
Usage: docker node rm [OPTIONS] NODE [NODE...]
|
2016-06-13 22:57:19 -04:00
|
|
|
|
2016-07-29 13:41:52 -04:00
|
|
|
Remove one or more nodes from the swarm
|
2016-06-13 22:57:19 -04:00
|
|
|
|
2016-07-07 14:43:18 -04:00
|
|
|
Aliases:
|
|
|
|
rm, remove
|
2016-06-13 22:57:19 -04:00
|
|
|
|
2016-07-07 14:43:18 -04:00
|
|
|
Options:
|
2016-07-28 00:17:00 -04:00
|
|
|
--force Force remove an active node
|
2016-07-07 14:43:18 -04:00
|
|
|
--help Print usage
|
|
|
|
```
|
|
|
|
|
2016-07-20 14:15:08 -04:00
|
|
|
Removes specified nodes from a swarm.
|
2016-06-13 22:57:19 -04:00
|
|
|
|
|
|
|
|
|
|
|
Example output:
|
|
|
|
|
|
|
|
$ docker node rm swarm-node-02
|
2016-07-20 14:15:08 -04:00
|
|
|
Node swarm-node-02 removed from swarm
|
2016-06-13 22:57:19 -04:00
|
|
|
|
2016-07-28 00:17:00 -04:00
|
|
|
Removes nodes from the swarm that are in the down state. Attempting to remove
|
|
|
|
an active node will result in an error:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ docker node rm swarm-node-03
|
|
|
|
Error response from daemon: rpc error: code = 9 desc = node swarm-node-03 is not down and can't be removed
|
|
|
|
```
|
|
|
|
|
|
|
|
If a worker node becomes compromised, exhibits unexpected or unwanted behavior, or if you lose access to it so
|
|
|
|
that a clean shutdown is impossible, you can use the force option.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ docker node rm --force swarm-node-03
|
|
|
|
Node swarm-node-03 removed from swarm
|
|
|
|
```
|
|
|
|
|
|
|
|
Note that manager nodes have to be demoted to worker nodes before they can be removed
|
|
|
|
from the cluster.
|
2016-06-13 22:57:19 -04:00
|
|
|
|
|
|
|
## Related information
|
|
|
|
|
|
|
|
* [node inspect](node_inspect.md)
|
|
|
|
* [node update](node_update.md)
|
2016-07-19 17:01:31 -04:00
|
|
|
* [node ps](node_ps.md)
|
2016-06-13 22:57:19 -04:00
|
|
|
* [node ls](node_ls.md)
|