In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article shows you what the most important concepts in Docker Swarm are. The content is concise and easy to understand. It will definitely make your eyes shine. I hope you can gain something from the detailed introduction of this article.
At the host level, Docker Swarm manages Docker Host clusters. So let's talk about an important concept-clustering.
A server cluster consists of a group of interconnected servers on a network that work together. The most significant differences between a cluster and a bunch of servers are:
Clusters are able to behave like a single system while providing high availability, Load Balancer, and parallel processing.
If we deploy applications and services on separate servers rather than clusters, overall resource utilization is less optimal because we cannot know in advance how to distribute these applications to maximize resource utilization. Moreover, trends in application usage fluctuate, with some services requiring a lot of memory in the morning and usage dropping off in the afternoon. Specifying in advance which servers applications should run on loses business resiliency, and when one server goes down, we have to manually migrate affected applications to other servers.
When clustering is implemented, we must change our way of thinking: instead of thinking of individual servers, we must think of the cluster as a whole.
When deploying an application, we only consider how much memory and CPU we need, not how much memory and CPU we will use on that server. We shouldn't care where the application is deployed, we care what resources are needed to run the application and deploy it to the cluster, and the cluster manager (such as Docker Swarm) takes care of these details.
The overall capacity of the cluster is adjusted by adding and removing host nodes to the cluster. But no matter what you do, the cluster is still a whole.
We create Docker Swarm clusters, deploy apps, scale apps, and perform rolling upgrades to apps.
Docker Swarm Mode
Docker v1.12 is a very important release, Docker re-implements the way clusters are organized. Before that, Docker Swarm, which provided clustering functionality, was a separate piece of software and relied on external databases (such as Consul, etcd, or Zookeeper).
Since v1.12, Docker Swarm functionality has been fully integrated with Docker Engine, and to manage clusters, you only need to start Swarm Mode. With Docker installed, Swarm is already there, and service discovery is there (no need to install an external database such as Consul).
Compared to Kubernetes, creating clusters with Docker Swarm is very simple, requiring no additional software installation and no additional configuration. It's a good starting point for learning about container orchestration engines.
important concept
Before you create a cluster, make a few concepts clear.
swarm
swarm A cluster of multiple hosts running Docker Engine.
Starting with v1.12, cluster management and orchestration capabilities have been integrated into Docker Engine. When Docker Engine initializes a swarm or joins an existing swarm, it initiates swarm mode.
Docker executes container commands when swarm mode is not enabled; Docker adds the ability to orchestrate services when swarm mode is running.
Docker allows you to run both a swarm service and a separate container on the same Docker host.
node
Each Docker Engine in a swarm is a node, and there are two types of nodes: manager and worker.
To deploy an application to a swarm, we need to execute the deployment command on the manager node, which disassembles the deployment task and assigns it to one or more worker nodes to complete the deployment.
The manager node performs orchestration and cluster management, keeping and maintaining the swarm in the desired state. If there are multiple manager nodes in a swarm, they will automatically negotiate and elect a leader to perform the scheduling task.
The walker node accepts and executes tasks assigned by the manager node. By default, the manager node is also a worker node, but it can be configured as a manager-only node to be fully responsible for orchestration and cluster management.
The work node periodically reports its status and the status of the tasks it is performing to the manager node so that the manager node can maintain the status of the entire cluster.
service
Service defines the tasks to be performed on the worker node. The primary orchestration task of a swarm is to ensure that service is in the desired state.
An example of a service: Start an http service in swarm using httpd:latest as the mirror and 3 copies.
The manager node is responsible for creating this service. After analysis, it knows that three httpd containers need to be started. According to the current status of each worker node, the task of running the container will be distributed. For example, two containers will run on worker1 and one container will run on worker2.
After running for a while, worker2 suddenly went down. Manager detected this failure and immediately started a new httpd container on worker3.
This ensures that the service is in the desired state of three copies.
What are the most important concepts in Docker Swarm, and have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserves, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.