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
Table of contents Vite project build optimization...
Preface The effect problems used in personal actu...
1. golang:latest base image mkdir gotest touch ma...
1. Window -> preferences to open the eclipse p...
500 (Internal Server Error) The server encountere...
I struggled with a problem for a long time and re...
Preface This article mainly introduces the method...
View the engines supported by the current databas...
This article example shares the specific code of ...
Preface: I recently started to study the construc...
Table of contents The node version does not corre...
Installed Docker V1.13.1 on centos7.3 using yum B...
Windows installation mysql-5.7.17-winx64.zip meth...
In order to extend the disk life for storing audi...
Website link: http://strml.net/ By Samuel Reed Ti...