TechTarget.com/searchitoperations

https://www.techtarget.com/searchitoperations/definition/Docker-Swarm

Docker Swarm

By Rahul Awati

What is Docker Swarm?

Docker Swarm is a container orchestration tool for clustering and scheduling Docker containers. With Swarm, IT administrators and developers can establish and manage a cluster of Docker nodes as a single virtual system.

Docker Swarm lets developers join multiple physical or virtual machines into a cluster. These individual machines are known as nodes or daemons.

Docker Swarm also lets admins and developers launch Docker containers, connect containers to multiple hosts, handle each node's resources and improve application availability throughout a system.

Docker Engine, the layer between the operating system and container images, natively uses Swarm mode. Swarm mode integrates the orchestration capabilities of Docker Swarm into Docker Engine 1.12 and subsequent releases. Docker Swarm uses the standard Docker API to interface with other Docker tools, such as Docker Machine.

What does Docker Swarm do?

The Docker platform includes a variety of tools, services, content and automations that help developers build, ship and run applications without configuring or managing the underlying development environment. With Docker, developers can package and run applications in lightweight containers -- loosely isolated environments that enable an application to run efficiently and seamlessly in many different conditions.

With Docker Swarm, containers can connect to multiple hosts. Each node in the cluster can then easily deploy and access any containers within that swarm. Docker Swarm includes multiple worker nodes and at least one manager node to control the cluster's activities and ensure its efficient operations.

Clustering is an important feature for container technology. It creates a cooperative group of systems that provide redundancy, enabling Docker Swarm failover if one or more nodes experience an outage. A Docker Swarm cluster also enables administrators and developers to add or subtract container iterations as computing demands change.

Docker Swarm manager node and worker nodes

An IT administrator controls Swarm through a swarm manager, which orchestrates and schedules containers within the swarm. The swarm manager, which is also a Docker node, lets a user create a primary manager instance and multiple replica instances in case the primary instance fails.

The manager node assigns tasks to the swarm's worker nodes and manages the swarm's activities. The worker nodes receive and execute the tasks assigned by the swarm manager when they have the resources to do so. In Docker Engine's swarm mode, a user can deploy manager and worker nodes using the swarm manager at runtime. A single swarm can have up to seven manager nodes.

Docker Swarm automated load balancing

Docker Swarm schedules tasks to ensure sufficient resources for all distributed containers in the swarm. It assigns containers to underlying nodes and optimizes resources by automatically scheduling container workloads to run on the most appropriate host. Such orchestration ensures containers are only launched on systems with adequate resources to maintain necessary performance and efficiency levels for containerized application workloads.

Swarm uses three different strategies to determine on which nodes each container should run:

Docker Swarm services

In Docker Swarm, users can deploy services in two ways: replicated and global.

Replicated services in swarm mode require the administrator to specify how many identical "replica" tasks must be assigned to available nodes by the swarm manager. By contrast, global services monitor all containers that run on a node; the swarm manager schedules only one task to each available node.

Docker Swarm filters

Swarm has five filters for scheduling containers:

Read about important Docker container backup best practices, and learn how to keep Docker secrets secret to improve security. Explore the differences between a Docker container vs. Docker image and how they interact as well as why and how to use Docker image tags. Prepare for successful container adoption with these tips, and see how to choose the best Docker image for the job at hand.

26 Jan 2024

All Rights Reserved, Copyright 2016 - 2025, TechTarget | Read our Privacy Statement