github.com/kobeld/docker@v1.12.0-rc1/docs/reference/commandline/swarm_join.md (about) 1 <!--[metadata]> 2 +++ 3 title = "swarm join" 4 description = "The swarm join command description and usage" 5 keywords = ["swarm, join"] 6 [menu.main] 7 parent = "smn_cli" 8 +++ 9 <![end-metadata]--> 10 11 **Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. 12 13 # swarm join 14 15 Usage: docker swarm join [OPTIONS] HOST:PORT 16 17 Join a Swarm as a node and/or manager. 18 19 Options: 20 --help Print usage 21 --listen-addr value Listen address (default 0.0.0.0:2377) 22 --manager Try joining as a manager. 23 --secret string Secret for node acceptance 24 25 Join a node to a Swarm cluster. If the `--manager` flag is specified, the docker engine 26 targeted by this command becomes a `manager`. If it is not specified, it becomes a `worker`. 27 28 ### Join a node to swarm as a manager 29 30 ```bash 31 $ docker swarm join --manager --listen-addr 192.168.99.122:2377 192.168.99.121:2377 32 This node is attempting to join a Swarm as a manager. 33 $ docker node ls 34 ID NAME STATUS AVAILABILITY/MEMBERSHIP MANAGER STATUS LEADER 35 2fg70txcrde2 swarm-node-01 READY ACTIVE REACHABLE 36 3l1f6uzcuoa3 * swarm-master READY ACTIVE REACHABLE Yes 37 ``` 38 39 ### Join a node to swarm as a worker 40 41 ```bash 42 $ docker swarm join --listen-addr 192.168.99.123:2377 192.168.99.121:2377 43 This node is attempting to join a Swarm. 44 $ docker node ls 45 ID NAME STATUS AVAILABILITY/MEMBERSHIP MANAGER STATUS LEADER 46 04zm7ue1fd1q swarm-node-02 READY ACTIVE 47 2fg70txcrde2 swarm-node-01 READY ACTIVE REACHABLE 48 3l1f6uzcuoa3 * swarm-master READY ACTIVE REACHABLE Yes 49 ``` 50 51 ### `--manager` 52 53 Joins the node as a manager 54 55 ### `--listen-addr value` 56 57 The node listens for inbound Swarm manager traffic on this IP:PORT 58 59 ### `--secret string` 60 61 Secret value required for nodes to join the swarm 62 63 64 ## Related information 65 66 * [swarm init](swarm_init.md) 67 * [swarm leave](swarm_leave.md) 68 * [swarm update](swarm_update.md)