github.com/kobeld/docker@v1.12.0-rc1/docs/swarm/swarm-tutorial/create-swarm.md (about)

     1  <!--[metadata]>
     2  +++
     3  title = "Create a Swarm"
     4  description = "Initialize the Swarm"
     5  keywords = ["tutorial, cluster management, swarm"]
     6  [menu.main]
     7  identifier="initialize-swarm"
     8  parent="swarm-tutorial"
     9  weight=12
    10  advisory = "rc"
    11  +++
    12  <![end-metadata]-->
    13  
    14  # Create a Swarm
    15  
    16  After you complete the [tutorial setup](index.md) steps, you're ready
    17  to create a Swarm. Make sure the Docker Engine daemon is started on the host
    18  machines.
    19  
    20  1. Open a terminal and ssh into the machine where you want to run your manager
    21  node. For example, the tutorial uses a machine named `manager1`.
    22  
    23  2. Run the following command to create a new Swarm:
    24  
    25      ```
    26      docker swarm init --listen-addr <MANAGER-IP>:<PORT>
    27      ```
    28  
    29      In the tutorial, the following command creates a Swarm on the `manager1` machine:
    30  
    31      ```
    32      $ docker swarm init --listen-addr 192.168.99.100:2377
    33  
    34      Swarm initialized: current node (09fm6su6c24qn) is now a manager.
    35      ```
    36  
    37      The `--listen-addr` flag configures the manager node to listen on port
    38      `2377`. The other nodes in the Swarm must be able to access the manager at
    39      the IP address.
    40  
    41  3. Run `docker info` to view the current state of the Swarm:
    42  
    43       ```
    44       $ docker info
    45  
    46       Containers: 2
    47        Running: 0
    48        Paused: 0
    49        Stopped: 2
    50       ...snip...
    51       Swarm:
    52        NodeID: 09fm6su6c24qn
    53        IsManager: YES
    54        Managers: 1
    55        Nodes: 1
    56       ...snip...
    57       ```
    58  
    59  4. Run the `docker node ls` command to view information about nodes:
    60  
    61      ```
    62      $ docker node ls
    63  
    64      ID              NAME      MEMBERSHIP  STATUS  AVAILABILITY  MANAGER STATUS  LEADER
    65  09fm6su6c24q *  manager1  Accepted    Ready   Active        Reachable       Yes
    66  
    67      ```
    68  
    69       The `*` next to the node id, indicates that you're currently connected on
    70       this node.
    71  
    72       Docker Swarm automatically names the node for the machine host name. The
    73       tutorial covers other columns in later steps.
    74  
    75  ## What's next?
    76  
    77  In the next section of the tutorial, we'll [add two more nodes](add-nodes.md) to
    78  the cluster.
    79  
    80  
    81  <p style="margin-bottom:300px">&nbsp;</p>