机器ip 172.31.47.10 docker网段172.17.0.0/16 flannel etcd
机器ip 172.31.36.233 d
ocker网段172.17.0.0/16 flannel etcd
yum install -y etcd flannel 两台
vim /etc/etcd/etcd.conf
ETCD_LISTEN_CLIENT_URLS=""
ETCD_ADVERTISE_CLIENT_URLS=""
systemctl enable etcd
systemctl start etcd
另外一台也要改成自己的ip
vim /etc/sysconfig/flanneld
FLANNEL_ETCD_ENDPOINTS=""
另外一台也要改成自己的ip
FLANNEL_ETCD_ENDPOINTS=""
FLANNEL_ETCD_PREFIX="/atomic.io/network"
配置 docker 容器的 IP地址, Flannel 使用Etcd进行配置,来保证多个Flannel实例之间的配置一致性,所以需要在etcd上进行如下配置
etcdctl mk /atomic.io/network/config '{ "Network": "172.24.0.0/16" }'
systemctl enable flanneld
systemctl start flanneld
vim /lib/systemd/system/docker.service# 修改
EnvironmentFile=-/run/flannel/docker # 增加
ExecStart=/usr/bin/dockerd $DOCKER_NETWORK_OPTIONS -H fd:// --containerd=/run/containerd/containerd.sock # 增加 $DOCKER_OPTS
systemctl daemon-reload
systemctl restart docker
阅读(219) | 评论(0) | 转发(0) |