Docker swarm simple tutorial

Docker swarm simple tutorial

swarm three virtual machines 132,133,134

1. Initialize a cluster and add yourself to the cluster

# Initialize the master node docker swarm init --advertise-addr 192.168.220.132

# 133,134 join worker Execute docker swarm join-token worker on 132 # Add worker (manager-- master node management node)

# Execute docker swarm join --token SWMTKN-1-49blzc9unsa1e8vcb4sonqx2q2rq02588jqjbhfzykowgtaoy1-57s37b21k0h39j0ywf6vd6la1 on the corresponding machine 192.168.220.132:2377 

insert image description here

2. View the node docker node ls

insert image description here

3. The master node creates service nginx replicas 1 (one service)

docker service create --replicas 1 --name manageNg -p 80:80 nginx

insert image description here

All three IPs can be accessed normally, but there is only one container instance.

insert image description here

View services: docker service ls

docker service ls

insert image description here

Dynamic scaling: docker service scale manageNg=5
Create five services

docker service scale manageNg=5 

insert image description here

5. View the instance; docker service ps manageNg

insert image description here

This is the end of this article about the simple use of Docker swarm. For more information about the use of Docker swarm, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Analysis of the use and principle of Docker Swarm cluster management
  • How to use Docker Swarm to build WordPress
  • Example of using Docker Swarm to build a distributed crawler cluster
  • How to use Docker Swarm to build a cluster
  • Detailed explanation of using Docker 1.12 to build a multi-host Docker swarm cluster
  • How to install Docker and use it in Docker Swarm mode

<<:  How to get/calculate the offset of a page element using JavaScript

>>:  Ten important questions for learning the basics of Javascript

Recommend

Teach you how to use webpack to package and compile TypeScript code

TypeScript Bundling webpack integration Usually, ...

HTML Basics: HTML Content Details

Let's start with the body: When viewing a web ...

MySQL configuration master-slave server (one master and multiple slaves)

Table of contents Ideas Host Configuration Modify...

MySQL concurrency control principle knowledge points

Mysql is a mainstream open source relational data...

Reasons and solutions for failure to insert emoji expressions in MySQL

Failure Scenario When calling JDBC to insert emoj...

Detailed explanation of soft links and hard links in Linux

Table of contents 1. Basic storage of files and d...

Detailed explanation of Vue advanced construction properties

Table of contents 1. Directive custom directive 2...

What are the new CSS :where and :is pseudo-class functions?

What are :is and :where? :is() and :where() are p...

Common problems and solutions during MySQL MGR construction

Table of contents 01 Common Faults 1 02 Common Fa...

JS implements Baidu search box

This article example shares the specific code of ...

How to configure Nginx domain name rewriting and wildcard domain name resolution

This article introduces how to configure Nginx to...

Vue storage contains a solution for Boolean values

Vue stores storage with Boolean values I encounte...

JavaScript Basics Variables

Table of contents 1. Variable Overview 1.1 Storag...