github.com/noxiouz/docker@v0.7.3-0.20160629055221-3d231c78e8c5/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  advisory = "rc"
     7  [menu.main]
     8  identifier="add-nodes"
     9  parent="swarm-tutorial"
    10  weight=13
    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      ID                           NAME      MEMBERSHIP  STATUS  AVAILABILITY  MANAGER STATUS  LEADER
    54      03g1y59jwfg7cf99w4lt0f662    worker2   Accepted    Ready   Active
    55      9j68exjopxe7wfl6yuxml7a7j    worker1   Accepted    Ready   Active
    56      dxn1zf6l61qsb1josjja83ngz *  manager1  Accepted    Ready   Active        Reachable       Yes
    57      ```
    58  
    59      The `MANAGER` column identifies the manager nodes in the swarm. The empty
    60      status in this column for `worker1` and `worker2` identifies them as worker nodes.
    61  
    62      Swarm management commands like `docker node ls` only work on manager nodes.
    63  
    64  
    65  ## What's next?
    66  
    67  Now your swarm consists of a manager and two worker nodes. In the next step of
    68  the tutorial, you [deploy a service](deploy-service.md) to the swarm.