What is the difference between docker Swarm and Swarm mode?
Docker Swarm (also Swarm classic) is fundamentally different from Swarm Mode. Native Swarm functionality will continue to be supported in Docker 1.12 release, this is done to preserve backward compatibility.
Docker Swarm (classic):
- Separate from Docker Engine and can run as Container
- Needs external KV store like Consul, etcd, Zookeeper
Usage example:
docker run swarm manage <consul-ip>
docker -H <worker-ip> run swarm join --advertise=<worker-ip> <consul-ip>
Swarm Mode (new, preferable):
- Integrated inside Docker engine
- No need of separate external KV store
Usage example:
docker swarm init --advertise-addr <manager-ip>
docker -H <worker-ip> swarm join --token <worker-token>
Docker Swarm is a separate product which you can use to cluster multiple Docker hosts. Prior to Docker version 1.12 it was the only native Docker option for clustering hosts, and it needed a lot of additional setup for distributed state, service discovery and security.
With Docker 1.12, Swarm Mode is built into Docker Engine. To run a cluster you just need to install Docker on multiple machines, run docker swarm init
to switch to Swarm Mode and docker swarm join
to add more nodes to the cluster. State, discovery and security are all included with zero setup.
Swarm Mode is optional, but if you want to run several Docker hosts it's the preferred way. You get reliability, load-balancing, scaling, and rolling service upgrades in 1.12, and it's likely that the bulk of new features will go into Swarm Mode. The original Docker Swarm product will probably only have maintenance updates in the future (although Swarm is open source, just like Docker Engine).
Docker Swarm:
Docker swarm is a service which allows users to create and manage a cluster of docker nodes and schedule container. Each node in docker swarm is a docker daemon and docker daemon interact using docker API.
Swarm Mode:
When we create a cluster of one or more Docker Engines its called a swarm mode. Swarm mode was introduced in Docker Engine 1.12. A swarm consists of one or more nodes physical or virtual machines running Docker Engine.