current position:Home>Docker tutorial of cloud computing core technology: docker swarm mode management is to add nodes to the cluster

Docker tutorial of cloud computing core technology: docker swarm mode management is to add nodes to the cluster

2021-08-31 16:42:53 TechWeb

When you first create a cluster , You will single Docker The engine is in cluster mode . Make full use of the group mode , You can add nodes to the group :

Adding work nodes will increase capacity . When you deploy services to swarm when , The engine schedules tasks on available nodes , Whether they are work nodes or management nodes . When you add staff to the cluster , You can increase the size of the cluster to handle tasks , Without affecting the manager raft Consensus .

Manager nodes improve fault tolerance . The manager node performs choreography and cluster management functions for the cluster . In the management node , A single leader node performs choreography tasks . If a leader node goes down , The remaining management nodes elect a new leader and restore the arrangement and maintenance of the cluster state . By default , The manager node also runs tasks .

Docker The engine is based on the... You provide to the command join-token Join in swarm docker swarm join. Nodes use tokens only when joining . If you then rotate tokens , Will not affect the existing swarm node .

Join as a work node

To retrieve the join command containing the join token of the work node , Run the following command on the manager node :

$ docker swarm join-token worker

To add a worker to this swarm, run the following command:

docker swarm join \

--token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \

stay worker Run the command in the output on to add swarm:

$ docker swarm join \

--token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \

This node joined a swarm as a worker.

The docker swarm join Command to do the following :

1. The... On the current node Docker Engine switch to swarm Pattern .

2. Request from manager TLS certificate .

3. Use the machine hostname to name the node

4. According to the group token, add the current node to the group where the manager listens for the address .

5. Set current node to Active Usability , This means that it can receive tasks from the scheduler .

6. take ingress The overlay network extends to the current node .

copyright notice
author[TechWeb],Please bring the original link to reprint, thank you.

Random recommended