Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to build swarm+etcd+docker environment

Shulou Source: shulou.com Published: 2022-06-01 01:15:31 10月04日 Update

This article mainly shows you "how to build a swarm+etcd+docker environment", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to build a swarm+etcd+docker environment" this article.

Machine allocation in experimental process

IP role 192.168.0.109Client192.168.0.201etcd192.168.0.202docker host1192.168.0.203docker host2192.168.0.204swarm management machine

Structure diagram

Description:

1. Etcd can be clustered, and any node in the cluster can read and write. You can experiment by yourself. Here, in order to simplify the whole structure, etcd uses a

2. Instead of using the image of the official website, the swarm in this experiment is compiled and installed on the physical machine.

3. Swarm management machine and all docker host hosts need to install swarm. The management node runs the swarm manage command and the docker host host runs the swarm join command

Etcd starts etcd on a stand-alone machine-- name etcd0-- initial-advertise-peer-urls http://192.168.0.201:2380\-- listen-peer-urls http://192.168.0.201:2380\-- listen-client-urls http://192.168.0.201:2379\-- advertise-client-urls http://192.168.0.201 : 2379\-- initial-cluster etcd0= http://192.168.0.201:2380swarm management machine starts

Swarm manage-H 0.0.0.0 2375 host configuration

First, configure docker to TCP listening mode, and the listening port for this experiment is 2375.

Next, add the docker host to the management machine and configure it as follows:

Docker host1

Swarm join-- advertise 192.168.0.202 etcd://192.168.0.201:2379/swarm

Docker host2

Swarm join-- advertise 192.168.0.203 etcd://192.168.0.201:2379/swarm

At this point, the whole structure is up.

These are all the contents of the article "how to build a swarm+etcd+docker Environment". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Management hosts experiments environment content articles structure configuration commands nodes clusters learning help monitoring running and then stand-alone easy to understand more machines Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information vpn Docker Huawei Shulou Technology