Docker Swarm in practice
Docker Engine includes the Swarm mode by default, so there is no additional installation process required. Since Docker Swarm is a native Docker clustering system, managing cluster nodes is done by the docker
command and is therefore very simple and intuitive. Let's start by creating a manager node with two worker nodes. Then, we will run and scale a service from a Docker image.
Setting up a Swarm
In order to set up a Swarm, we need to initialize the manager node. We can do this using the following command on a machine that is supposed to become the manager:
$ docker swarm init Swarm initialized: current node (qfqzhk2bumhd2h0ckntrysm8l) is now a manager. To add a worker to this swarm, run the following command: docker swarm join \ --token SWMTKN-1-253vezc1pqqgb93c5huc9g3n0hj4p7xik1ziz5c4rsdo3f7iw2-df098e2jpe8uvwe2ohhhcxd6w \ 192.168.0.143:2377 To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
Note
A very common practice...