github.com/kobeld/docker@v1.12.0-rc1/docs/swarm/swarm-tutorial/add-nodes.md (about) 1 <!--[metadata]> 2 +++ 3 title = "Add nodes to the Swarm" 4 description = "Add nodes to the Swarm" 5 keywords = ["tutorial, cluster management, swarm"] 6 [menu.main] 7 identifier="add-nodes" 8 parent="swarm-tutorial" 9 weight=13 10 advisory = "rc" 11 +++ 12 <![end-metadata]--> 13 14 # Add nodes to the Swarm 15 16 Once you've [created a Swarm](create-swarm.md) with a manager node, you're ready 17 to add worker nodes. 18 19 1. Open a terminal and ssh into the machine where you want to run a worker node. 20 This tutorial uses the name `worker1`. 21 22 2. Run the following command to create a worker node joined to 23 the existing Swarm: 24 25 ``` 26 docker swarm join <MANAGER-IP>:<PORT> 27 ``` 28 29 Replace `<MANAGER-IP>` with the address of the manager node and `<PORT>` 30 with the port where the manager listens. 31 32 In the tutorial, the following command joins `worker1` to the Swarm on `manager1`: 33 34 ``` 35 $ docker swarm join 192.168.99.100:2377 36 37 This node joined a Swarm as a worker. 38 ``` 39 40 3. Open a terminal and ssh into the machine where you want to run a second 41 worker node. This tutorial uses the name `worker2`. 42 43 4. Run `docker swarm join <MANAGER-IP>:<PORT>` to create a worker node joined to 44 the existing Swarm. 45 46 Replace `<MANAGER-IP>` with the address of the manager node and `<PORT>` 47 with the port where the manager listens. 48 49 5. Open a terminal and ssh into the machine where the manager node runs and run 50 the `docker node ls` command to see the worker nodes: 51 52 ```bash 53 $ docker node ls 54 55 ID NAME MEMBERSHIP STATUS AVAILABILITY MANAGER STATUS LEADER 56 09fm6su6c24q * manager1 Accepted Ready Active Reachable Yes 57 32ljq6xijzb9 worker1 Accepted Ready Active 58 38fsncz6fal9 worker2 Accepted Ready Active 59 ``` 60 61 The `MANAGER` column identifies the manager nodes in the Swarm. The empty 62 status in this column for `worker1` and `worker2` identifies them as worker nodes. 63 64 Swarm management commands like `docker node ls` only work on manager nodes. 65 66 67 ## What's next? 68 69 Now your Swarm consists of a manager and two worker nodes. In the next step of 70 the tutorial, you [deploy a service](deploy-service.md) to the Swarm. 71 72 <p style="margin-bottom:300px"> </p>