安裝 etcd (略)linux
使用命令配置flannel網段 (在 etcd 服務端) >etcdctl mk /coreos.com/network/config '{"Network":"172.17.0.0/16", "SubnetMin": "172.17.1.0", "SubnetMax": "172.17.254.0"}'git
安裝 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/flannelgithub
添加啓動服務 vi /usr/lib/systemd/system/flanneld.servicedocker
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
檢查是否OKcentos
和docker 集成 ./mk-docker-opts.sh -i cat /run/docker_opts.env 將顯示的內容添加到docker啓動中 vi /etc/sysconfig/docker Add: OPTIONS='--selinux-enabled --bip={對應參數}/24 --ip-masq=true --mtu=1472' systemctl restart docker Ip abash
測試: d1:docker run -ti centos bash d2:docker run -ti centos bash d1 d2互ping便可服務器