What is Docker Swarm and how to deploy a simple container cluster?
Docker Swarm is a container orchestration and clustering system built directly into the Docker ecosystem. It allows you to combine multiple physical or virtual machines into a single virtual server managed by the standard Docker daemon. Unlike more complex external orchestrators like Kubernetes, Swarm does not require the installation of bulky third-party tools, has a low barrier to entry, and is great for small and medium-sized projects that need scaling and high availability.
The Swarm cluster architecture is divided into two types of nodes: manager nodes and worker nodes. Manager nodes accept administrator commands, distribute container creation tasks, and maintain the current state of the cluster. Worker nodes are directly engaged in launching and maintaining containers in a working state. Communication within the cluster is secured using automatic TLS traffic encryption.
To create and run a basic Swarm cluster, you need to perform the following sequential steps.
Using the built-in orchestrator makes it easy to scale application load, automatically restart failed containers on active cluster nodes, and balance incoming network traffic between replicas without writing complex infrastructure code.