Docker Swarm (https://docs.docker.com/engine/swarm/) is native clustering that is built in to Docker. It groups multiple Docker hosts into a single pool in which you can launch containers. To keep things simple, here, we'll use VirtualBox as the backend to configure the hosts.
There are two versions of Swarm. In this recipe, we will be using the newer of the two called Docker Swarm mode, which is based on SwarmKit (https://github.com/docker/swarmkit). The newer version makes it much easier to get up and running, and removes a lot of the steps that were previously required. Swarm mode is built into the Docker daemon, so there is no extra software required in order to use it.
Docker Swarm mode supports two types of nodes; a manager and a worker. Manager nodes perform the orchestration and cluster management functions for the Swarm. They...