Environmental Description
1. Docker configurationAll physical machines need to be configured. Just change the corresponding network card name eno3 and consul address sudo vim /lib/systemd/system/docker.service #ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock --cluster-store=consul://192.168.20.5:8500 --cluster-advertise=eno3:2376 --insecure-registry=0.0.0.0/0
Check startup sudo systemctl daemon-reload sudo systemctl restart docker.service ps -ef | grep dockerd 2. Create a registry and networkCreate a network segment and network name on consul docker run -d -p 8400:8400 -p 8500:8500 -p 8600:53/udp -h consul progrium/consul-server -bootstrap -ui-dir /ui # Create a subnet, and the network will be automatically synchronized to other machines docker network create -d overlay --subnet=192.168.21.0/24 overlay-net Check docker ps docker network ls View the physical machines connected to the registry 3. Start the containerContainer names cannot be repeated # On 192.168.20.5 docker run -d -it --name test1 --net=overlay-net centos bash # On 192.168.20.6 docker run -d -it --name test2 --net=overlay-net centos bash # On 192.168.20.7 docker run -d -it --name test3 --net=overlay-net centos bash It can be seen that they can ping each other This is the end of this article about docker overlay to achieve cross-host container interoperability. For more relevant docker container interoperability content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
>>: JavaScript basics for loop and array
Recently, there is a particularly abnormal busine...
Because the distribution package of MySQL Communi...
Duplicate form submission is the most common and ...
1. Create a Docker network docker network create ...
Table of contents 1. Requirements description 2. ...
A. Installation of MySQL backup tool xtrabackup 1...
This article shares the specific code of js to im...
The overall architecture of NGINX is characterize...
I was working on a pop-up ad recently. Since the d...
Step 1: View the current kernel rew $ uname -a Li...
Table of contents 1. Brief Introduction 2. Run sc...
Table of contents Zabbix monitors Nginx Zabbix mo...
Preface When developing a gateway project, the si...
Configure Mysql master-slave service implementati...
1. Use frameset, frame and iframe to realize mult...