1
0
mirror of https://github.com/docker/cli.git synced 2026-01-22 03:22:01 +03:00
Files
cli/components/engine/docs/reference/commandline/swarm_join.md
Amit Shukla 69f307bc8b CLI docs
Signed-off-by: Amit Shukla <amit.shukla@docker.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 9acf97b72a4d5ff7b1bcad36fb19b53775f01596
Component: engine
2016-06-13 22:17:15 -07:00

69 lines
2.1 KiB
Markdown

<!--[metadata]>
+++
title = "swarm join"
description = "The swarm join command description and usage"
keywords = ["swarm, join"]
[menu.main]
parent = "smn_cli"
+++
<![end-metadata]-->
**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes.
# swarm join
Usage: docker swarm join [OPTIONS] HOST:PORT
Join a Swarm as a node and/or manager.
Options:
--help Print usage
--listen-addr value Listen address (default 0.0.0.0:2377)
--manager Try joining as a manager.
--secret string Secret for node acceptance
Join a node to a Swarm cluster. If the `--manager` flag is specified, the docker engine
targeted by this command becomes a `manager`. If it is not specified, it becomes a `worker`.
### Join a node to swarm as a manager
```bash
$ docker swarm join --manager --listen-addr 192.168.99.122:2377 192.168.99.121:2377
This node is attempting to join a Swarm as a manager.
$ docker node ls
ID NAME STATUS AVAILABILITY/MEMBERSHIP MANAGER STATUS LEADER
2fg70txcrde2 swarm-node-01 READY ACTIVE REACHABLE
3l1f6uzcuoa3 * swarm-master READY ACTIVE REACHABLE Yes
```
### Join a node to swarm as a worker
```bash
$ docker swarm join --listen-addr 192.168.99.123:2377 192.168.99.121:2377
This node is attempting to join a Swarm.
$ docker node ls
ID NAME STATUS AVAILABILITY/MEMBERSHIP MANAGER STATUS LEADER
04zm7ue1fd1q swarm-node-02 READY ACTIVE
2fg70txcrde2 swarm-node-01 READY ACTIVE REACHABLE
3l1f6uzcuoa3 * swarm-master READY ACTIVE REACHABLE Yes
```
### `--manager`
Joins the node as a manager
### `--listen-addr value`
The node listens for inbound Swarm manager traffic on this IP:PORT
### `--secret string`
Secret value required for nodes to join the swarm
## Related information
* [swarm init](swarm_init.md)
* [swarm leave](swarm_leave.md)
* [swarm update](swarm_update.md)