2016-06-07 17:08:36 -07:00
|
|
|
|
<!--[metadata]>
|
|
|
|
|
+++
|
|
|
|
|
title = "Set up for the tutorial"
|
2016-06-15 13:26:13 -07:00
|
|
|
|
description = "Getting Started tutorial for Docker Engine swarm mode"
|
|
|
|
|
keywords = ["tutorial, cluster management, swarm mode"]
|
2016-06-07 17:08:36 -07:00
|
|
|
|
[menu.main]
|
|
|
|
|
identifier="tutorial-setup"
|
|
|
|
|
parent="swarm-tutorial"
|
|
|
|
|
weight=11
|
|
|
|
|
+++
|
|
|
|
|
<![end-metadata]-->
|
|
|
|
|
|
2016-06-15 13:26:13 -07:00
|
|
|
|
# Getting started with swarm mode
|
2016-06-07 17:08:36 -07:00
|
|
|
|
|
2016-06-15 13:26:13 -07:00
|
|
|
|
This tutorial introduces you to the features of Docker Engine Swarm mode. You
|
|
|
|
|
may want to familiarize yourself with the [key concepts](../key-concepts.md)
|
|
|
|
|
before you begin.
|
2016-06-07 17:08:36 -07:00
|
|
|
|
|
2016-06-15 13:26:13 -07:00
|
|
|
|
The tutorial guides you through the following activities:
|
|
|
|
|
|
|
|
|
|
* initializing a cluster of Docker Engines in swarm mode
|
|
|
|
|
* adding nodes to the swarm
|
|
|
|
|
* deploying application services to the swarm
|
|
|
|
|
* managing the swarm once you have everything running
|
2016-06-07 17:08:36 -07:00
|
|
|
|
|
|
|
|
|
This tutorial uses Docker Engine CLI commands entered on the command line of a
|
|
|
|
|
terminal window. You should be able to install Docker on networked machines and
|
|
|
|
|
be comfortable running commands in the shell of your choice.
|
|
|
|
|
|
|
|
|
|
If you’re brand new to Docker, see [About Docker Engine](../../index.md).
|
|
|
|
|
|
|
|
|
|
## Set up
|
2016-06-15 13:26:13 -07:00
|
|
|
|
|
2016-06-07 17:08:36 -07:00
|
|
|
|
To run this tutorial, you need the following:
|
|
|
|
|
|
|
|
|
|
* [three networked host machines](#three-networked-host-machines)
|
|
|
|
|
* [Docker Engine 1.12 or later installed](#docker-engine-1-12-or-later)
|
|
|
|
|
* [the IP address of the manager machine](#the-ip-address-of-the-manager-machine)
|
|
|
|
|
* [open ports between the hosts](#open-ports-between-the-hosts)
|
|
|
|
|
|
|
|
|
|
### Three networked host machines
|
|
|
|
|
|
2016-06-15 13:26:13 -07:00
|
|
|
|
The tutorial uses three networked host machines as nodes in the swarm. These can
|
2016-06-07 17:08:36 -07:00
|
|
|
|
be virtual machines on your PC, in a data center, or on a cloud service
|
|
|
|
|
provider. This tutorial uses the following machine names:
|
|
|
|
|
|
|
|
|
|
* manager1
|
|
|
|
|
* worker1
|
|
|
|
|
* worker2
|
|
|
|
|
|
|
|
|
|
### Docker Engine 1.12 or later
|
|
|
|
|
|
2016-08-04 15:11:43 -07:00
|
|
|
|
To use swarm mode, you must [install Docker Engine](../../installation/index.md)
|
|
|
|
|
on each one of the host machines. Alternatively, install the latest Docker for
|
|
|
|
|
Mac or Docker for Windows.
|
2016-06-15 13:26:13 -07:00
|
|
|
|
|
2016-08-04 15:11:43 -07:00
|
|
|
|
>**Note**: Docker for Mac and Docker for Windows let you use single-node
|
|
|
|
|
features of swarm mode, like creating a swarm and creating a service. Multi-node
|
|
|
|
|
features like joining additional nodes and scaling a service are not available.
|
2016-06-07 17:08:36 -07:00
|
|
|
|
|
|
|
|
|
Verify that the Docker Engine daemon is running on each of the machines.
|
|
|
|
|
|
|
|
|
|
### The IP address of the manager machine
|
|
|
|
|
|
|
|
|
|
The IP address must be assigned to an a network interface available to the host
|
2016-06-15 13:26:13 -07:00
|
|
|
|
operating system. All nodes in the swarm must be able to access the manager at the IP address.
|
2016-06-07 17:08:36 -07:00
|
|
|
|
|
2016-07-21 13:12:23 -07:00
|
|
|
|
Because other nodes contact the manager node on its IP address, you should use a
|
|
|
|
|
fixed IP address.
|
|
|
|
|
|
2016-06-15 13:26:13 -07:00
|
|
|
|
>**Tip**: You can run `ifconfig` on Linux or Mac OS X to see a list of the
|
2016-06-07 17:08:36 -07:00
|
|
|
|
available network interfaces.
|
|
|
|
|
|
|
|
|
|
The tutorial uses `manager1` : `192.168.99.100`.
|
|
|
|
|
|
|
|
|
|
### Open ports between the hosts
|
|
|
|
|
|
|
|
|
|
* **TCP port 2377** for cluster management communications
|
|
|
|
|
* **TCP** and **UDP port 7946** for communication among nodes
|
|
|
|
|
* **TCP** and **UDP port 4789** for overlay network traffic
|
|
|
|
|
|
|
|
|
|
## What's next?
|
|
|
|
|
|
2016-06-15 13:26:13 -07:00
|
|
|
|
After you have set up your environment, you're ready to [create a swarm](create-swarm.md).
|