2016-10-14 18:30:36 -04:00
|
|
|
---
|
|
|
|
title: "node rm"
|
|
|
|
description: "The node rm command description and usage"
|
2016-11-03 18:48:30 -04:00
|
|
|
keywords: "node, remove"
|
2016-10-14 18:30:36 -04:00
|
|
|
---
|
2016-06-13 22:57:19 -04:00
|
|
|
|
2016-10-19 13:25:45 -04:00
|
|
|
<!-- This file is maintained within the docker/docker Github
|
|
|
|
repository at https://github.com/docker/docker/. Make all
|
|
|
|
pull requests against that repo. If you see this file in
|
|
|
|
another repository, consider it read-only there, as it will
|
|
|
|
periodically be overwritten by the definitive file. Pull
|
|
|
|
requests which include edits to this file in other repositories
|
|
|
|
will be rejected.
|
|
|
|
-->
|
|
|
|
|
2016-06-13 22:57:19 -04:00
|
|
|
# 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-11-02 05:22:04 -04:00
|
|
|
--force Force remove a node from the swarm
|
2016-07-07 14:43:18 -04:00
|
|
|
--help Print usage
|
|
|
|
```
|
|
|
|
|
2016-09-01 18:38:25 -04:00
|
|
|
When run from a manager node, removes the specified nodes from a swarm.
|
2016-06-13 22:57:19 -04:00
|
|
|
|
|
|
|
|
|
|
|
Example output:
|
|
|
|
|
2016-09-01 18:38:25 -04:00
|
|
|
```nohighlight
|
|
|
|
$ docker node rm swarm-node-02
|
2016-06-13 22:57:19 -04:00
|
|
|
|
2016-09-01 18:38:25 -04:00
|
|
|
Node swarm-node-02 removed from swarm
|
|
|
|
```
|
|
|
|
|
|
|
|
Removes the specified nodes from the swarm, but only if the nodes are in the
|
|
|
|
down state. If you attempt to remove an active node you will receive an error:
|
2016-07-28 00:17:00 -04:00
|
|
|
|
2016-09-01 18:38:25 -04:00
|
|
|
```nohighlight
|
2016-07-28 00:17:00 -04:00
|
|
|
$ docker node rm swarm-node-03
|
2016-09-01 18:38:25 -04:00
|
|
|
|
|
|
|
Error response from daemon: rpc error: code = 9 desc = node swarm-node-03 is not
|
|
|
|
down and can't be removed
|
2016-07-28 00:17:00 -04:00
|
|
|
```
|
|
|
|
|
2016-09-01 18:38:25 -04:00
|
|
|
If you lose access to a worker node or need to shut it down because it has been
|
|
|
|
compromised or is not behaving as expected, you can use the `--force` option.
|
|
|
|
This may cause transient errors or interruptions, depending on the type of task
|
|
|
|
being run on the node.
|
2016-07-28 00:17:00 -04:00
|
|
|
|
2016-09-01 18:38:25 -04:00
|
|
|
```nohighlight
|
2016-07-28 00:17:00 -04:00
|
|
|
$ docker node rm --force swarm-node-03
|
2016-09-01 18:38:25 -04:00
|
|
|
|
2016-07-28 00:17:00 -04:00
|
|
|
Node swarm-node-03 removed from swarm
|
|
|
|
```
|
|
|
|
|
2016-09-01 18:38:25 -04:00
|
|
|
A manager node must be demoted to a worker node (using `docker node demote`)
|
|
|
|
before you can remove it from the swarm.
|
2016-06-13 22:57:19 -04:00
|
|
|
|
|
|
|
## Related information
|
|
|
|
|
|
|
|
* [node inspect](node_inspect.md)
|
|
|
|
* [node update](node_update.md)
|
2016-09-01 18:38:25 -04:00
|
|
|
* [node demote](node_demote.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)
|