github.com/dpiddy/docker@v1.12.2-rc1/docs/swarm/swarm-tutorial/index.md (about)

     1  <!--[metadata]>
     2  +++
     3  title = "Set up for the tutorial"
     4  description = "Getting Started tutorial for Docker Engine swarm mode"
     5  keywords = ["tutorial, cluster management, swarm mode"]
     6  [menu.main]
     7  identifier="tutorial-setup"
     8  parent="swarm-tutorial"
     9  weight=11
    10  +++
    11  <![end-metadata]-->
    12  
    13  # Getting started with swarm mode
    14  
    15  This tutorial introduces you to the features of Docker Engine Swarm mode. You
    16  may want to familiarize yourself with the [key concepts](../key-concepts.md)
    17  before you begin.
    18  
    19  The tutorial guides you through the following activities:
    20  
    21  * initializing a cluster of Docker Engines in swarm mode
    22  * adding nodes to the swarm
    23  * deploying application services to the swarm
    24  * managing the swarm once you have everything running
    25  
    26  This tutorial uses Docker Engine CLI commands entered on the command line of a
    27  terminal window. You should be able to install Docker on networked machines and
    28  be comfortable running commands in the shell of your choice.
    29  
    30  If you are brand new to Docker, see [About Docker Engine](../../index.md).
    31  
    32  ## Set up
    33  
    34  To run this tutorial, you need the following:
    35  
    36  * [three networked host machines](#three-networked-host-machines)
    37  * [Docker Engine 1.12 or later installed](#docker-engine-1-12-or-later)
    38  * [the IP address of the manager machine](#the-ip-address-of-the-manager-machine)
    39  * [open ports between the hosts](#open-ports-between-the-hosts)
    40  
    41  ### Three networked host machines
    42  
    43  The tutorial uses three networked host machines as nodes in the swarm. These can
    44  be virtual machines on your PC, in a data center, or on a cloud service
    45  provider. This tutorial uses the following machine names:
    46  
    47  * manager1
    48  * worker1
    49  * worker2
    50  
    51  >**Note:** You can follow many of the tutorial steps to test single-node swarm
    52  as well, in which case you need only one host. Multi-node commands will not
    53  work, but you can initialize a swarm, create services, and scale them.
    54  
    55  ###  Docker Engine 1.12 or newer
    56  
    57  This tutorial requires Docker Engine 1.12 or newer on each of the host machines.
    58  Install Docker Engine and verify that the Docker Engine daemon is running on
    59  each of the machines. You can get the latest version of Docker Engine as
    60  follows:
    61  
    62  * [install Docker Engine on Linux machines](#install-docker-engine-on-linux-machines)
    63  
    64  * [use Docker for Mac or Docker for Windows](#use-docker-for-mac-or-docker-for-windows)
    65  
    66  #### Install Docker Engine on Linux machines
    67  
    68  If you are using Linux based physical computers or cloud-provided computers as
    69  hosts, simply follow the [Linux install
    70  instructions](../../installation/index.md) for your platform. Spin up the three
    71  machines, and you are ready. You can test both
    72  single-node and multi-node swarm scenarios on Linux machines.
    73  
    74  #### Use Docker for Mac or Docker for Windows
    75  
    76  Alternatively, install the latest [Docker for Mac](/docker-for-mac/index.md) or
    77  [Docker for Windows](/docker-for-windows/index.md) application on a one
    78  computer. You can test both single-node and multi-node swarm from this computer,
    79  but you will need to use Docker Machine to test the multi-node scenarios.
    80  
    81  * You can use Docker for Mac or Windows to test _single-node_ features of swarm
    82  mode, including initializing a swarm with a single node, creating services,
    83  and scaling services. Docker "Moby" on Hyperkit (Mac) or Hyper-V (Windows)
    84  will serve as the single swarm node.
    85  
    86  <p />
    87  
    88  * Currently, you cannot use Docker for Mac or Windows alone to test a
    89  _multi-node_ swarm. However, you can use the included version of [Docker
    90  Machine](/machine/overview.md) to create the swarm nodes, then follow the
    91  tutorial for all multi-node features. For this scenario, you run commands from
    92  a Docker for Mac or Docker for Windows host, but that Docker host itself is
    93  _not_ participating in the swarm (i.e., it will not be `manager1`, `worker1`,
    94  or `worker2` in our example). After you create the nodes, you can run all
    95  swarm commands as shown from the Mac terminal or Windows PowerShell with
    96  Docker for Mac or Docker for Windows running.
    97  
    98  ### The IP address of the manager machine
    99  
   100  The IP address must be assigned to a network interface available to the host
   101  operating system. All nodes in the swarm must be able to access the manager at
   102  the IP address.
   103  
   104  Because other nodes contact the manager node on its IP address, you should use a
   105  fixed IP address.
   106  
   107  You can run `ifconfig` on Linux or Mac OS X to see a list of the
   108  available network interfaces.
   109  
   110  If you are using Docker Machine, you can get the manager IP with either
   111  `docker-machine ls` or `docker-machine ip <MACHINE-NAME>` &#8212; for example,
   112  `docker-machine ip manager1`.
   113  
   114  The tutorial uses `manager1` : `192.168.99.100`.
   115  
   116  ### Open ports between the hosts
   117  
   118  The following ports must be available. On some systems, these ports are open by default.
   119  
   120  * **TCP port 2377** for cluster management communications
   121  * **TCP** and **UDP port 7946** for communication among nodes
   122  * **TCP** and **UDP port 4789** for overlay network traffic
   123  
   124  ## What's next?
   125  
   126  After you have set up your environment, you are ready to [create a swarm](create-swarm.md).