How to realize Multi-computer Interconnection with etcd + flannel in docker
This article mainly introduces the docker etcd + flannel how to achieve multi-computer interconnection, the article is very detailed, has a certain reference value, interested friends must read it!
Install etcd (abbreviated)
Use the command to configure the flannel segment (on the etcd server) > etcdctl mk / coreos.com/network/config'{"Network": "172.17.0.0 Network", "SubnetMin": "172.17.1.0", "SubnetMax": "172.17.254.0"}'
Install flannel > wget https://github.com/coreos/flannel/releases/download/v0.5.5/flannel-0.5.5-linux-amd64.tar.gz > tar zxvf flannel-x.tar.gz > cd flannel-x/flannel
Add Startup Service vi / usr/lib/systemd/system/flanneld.service
Add: Description=flannel [Service] ExecStart=/data/dev/vm/network/flannel-0.5.5/flanneld\-etcd-endpoints= http://{etcd_ip}:2379,http://{etcd_ip}:2379,http://{etcd_ip}:2379 [Install] WantedBy=multi-user.target systemctl start flanneld systemctl status flanneld
Check to see if OK
View IP: ip a displays the flannel0 network card
View etcdctl ls / coreos.com/network/subnets on ectd server to view flannel network segment
Integrate with docker. / mk-docker-opts.sh-I cat / run/docker_opts.env adds the displayed content to the docker startup vi / etc/sysconfig/docker Add: OPTIONS='--selinux-enabled-- bip= {corresponding parameter} / 24-- ip-masq=true-- mtu=1472' systemctl restart docker Ip a
Test: d1:docker run-ti centos bash d2:docker run-ti centos bash D1 / D2 mutual ping
The above is all the contents of the article "how to realize the interconnection of etcd and flannel in docker". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!