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

Linux file system operation implementation

This reading note mainly records the operations r...

Introduction to 10 online development tools for web design

1. Online Text Generator BlindTextGenerator: For ...

Web page printing thin line table + page printing ultimate strategy

When I was printing for a client recently, he aske...

Some experience in building the React Native project framework

React Native is a cross-platform mobile applicati...

Bug of Chinese input garbled characters in flex program Firefox

Chinese characters cannot be input in lower versio...

How to pass the value of the select drop-down box to the id to implement the code

The complete code is as follows : HTML code: Copy ...

mysql 5.7.17 winx64.zip installation and configuration method graphic tutorial

Preface: I reinstalled win10 and organized the fi...

Analysis of rel attribute in HTML

.y { background: url(//img.jbzj.com/images/o_y.pn...

Summary of several common methods of JavaScript arrays

Table of contents 1. Introduction 2. filter() 3. ...

TypeScript union types, intersection types and type guards

Table of contents 1. Union Type 2. Crossover Type...

Newbies quickly learn the steps to create website icons

<br />Original URL: http://www.lxdong.com/po...

Front-end vue+express file upload and download example

Create a new server.js yarn init -y yarn add expr...

CSS3 creates web animation to achieve bouncing ball effect

Basic preparation For this implementation, we nee...