github.com/portworx/docker@v1.12.1/docs/swarm/key-concepts.md (about) 1 <!--[metadata]> 2 +++ 3 title = "Swarm mode key concepts" 4 description = "Introducing key concepts for Docker Engine swarm mode" 5 keywords = ["docker, container, cluster, swarm mode"] 6 [menu.main] 7 identifier="swarm-mode-concepts" 8 parent="engine_swarm" 9 weight="2" 10 +++ 11 <![end-metadata]--> 12 # Swarm mode key concepts 13 14 This topic introduces some of the concepts unique to the cluster management and 15 orchestration features of Docker Engine 1.12. 16 17 ## Swarm 18 19 The cluster management and orchestration features embedded in the Docker Engine 20 are built using **SwarmKit**. Engines participating in a cluster are 21 running in **swarm mode**. You enable swarm mode for the Engine by either 22 initializing a swarm or joining an existing swarm. 23 24 A **swarm** is a cluster of Docker Engines where you deploy 25 [services](#Services-and-tasks). The Docker Engine CLI includes the commands for 26 swarm management, such as adding and removing nodes. The CLI also includes the 27 commands you need to deploy services to the swarm and manage service 28 orchestration. 29 30 When you run Docker Engine outside of swarm mode, you execute container 31 commands. When you run the Engine in swarm mode, you orchestrate services. 32 33 ## Node 34 35 A **node** is an instance of the Docker Engine participating in the swarm. 36 37 To deploy your application to a swarm, you submit a service definition to a 38 **manager node**. The manager node dispatches units of work called 39 [tasks](#Services-and-tasks) to worker nodes. 40 41 Manager nodes also perform the orchestration and cluster management functions 42 required to maintain the desired state of the swarm. Manager nodes elect a single leader to conduct orchestration tasks. 43 44 **Worker nodes** receive and execute tasks dispatched from manager nodes. By 45 default manager nodes are also worker nodes, but you can configure managers to 46 be manager-only nodes. The agent notifies the manager node of the current 47 state of its assigned tasks so the manager can maintain the desired state. 48 49 ## Services and tasks 50 51 A **service** is the definition of the tasks to execute on the worker nodes. It 52 is the central structure of the swarm system and the primary root of user 53 interaction with the swarm. 54 55 When you create a service, you specify which container image to use and which 56 commands to execute inside running containers. 57 58 In the **replicated services** model, the swarm manager distributes a specific 59 number of replica tasks among the nodes based upon the scale you set in the 60 desired state. 61 62 For **global services**, the swarm runs one task for the service on every 63 available node in the cluster. 64 65 A **task** carries a Docker container and the commands to run inside the 66 container. It is the atomic scheduling unit of swarm. Manager nodes assign tasks 67 to worker nodes according to the number of replicas set in the service scale. 68 Once a task is assigned to a node, it cannot move to another node. It can only 69 run on the assigned node or fail. 70 71 ## Load balancing 72 73 The swarm manager uses **ingress load balancing** to expose the services you 74 want to make available externally to the swarm. The swarm manager can 75 automatically assign the service a **PublishedPort** or you can configure a 76 PublishedPort for the service in the 30000-32767 range. 77 78 External components, such as cloud load balancers, can access the service on the 79 PublishedPort of any node in the cluster whether or not the node is currently 80 running the task for the service. All nodes in the swarm route ingress 81 connections to a running task instance. 82 83 Swarm mode has an internal DNS component that automatically assigns each service 84 in the swarm a DNS entry. The swarm manager uses **internal load balancing** to 85 distribute requests among services within the cluster based upon the DNS name of 86 the service. 87 88 ## What's next? 89 * Read the [swarm mode overview](index.md). 90 * Get started with the [swarm mode tutorial](swarm-tutorial/index.md).