Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between docker Swarm and Swarm mode?

Tags:

I was wondering if anyone could differentiate between these two.Both of them have similar naming.

like image 354
Abhay Dwivedi Avatar asked Oct 14 '16 08:10

Abhay Dwivedi


People also ask

What is swarm mode in Docker?

Docker Engine 1.12 introduces swarm mode that enables you to create a cluster of one or more Docker Engines called a swarm. A swarm consists of one or more nodes: physical or virtual machines running Docker Engine 1.12 or later in swarm mode. There are two types of nodes: managers and workers.

What is swarm mode?

Swarm mode is a Docker feature that provides built in container orchestration capabilities, including native clustering of Docker hosts and scheduling of container workloads.

What is difference between Docker and Docker Swarm?

The difference between Docker Swarm and Docker Compose is that Compose is used for configuring multiple containers in the same host. Docker Swarm is different in that it is a container orchestration tool. This means that Docker Swarm lets you connect containers to multiple hosts similar to Kubernetes.

What are the two types of Docker swarm services?

Swarm mode has two types of services: replicated and global. For replicated services, you specify the number of replica tasks for the swarm manager to schedule onto available nodes.


2 Answers

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).

like image 124
Elton Stoneman Avatar answered Oct 20 '22 07:10

Elton Stoneman


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> 
like image 33
giokoguashvili Avatar answered Oct 20 '22 07:10

giokoguashvili