1、etcd 配置以及常用命令
yum install etcd
[root@localhost ~]# cat /etc/etcd/etcd.conf | grep -v "#"
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_PEER_URLS="http://10.1.204.164:2380,http://localhost:2380"
ETCD_LISTEN_CLIENT_URLS="http://10.1.204.164:2379,http://localhost:2379"
ETCD_NAME="mobvoi"
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.1.204.164:2380,http://localhost:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://10.1.204.164:2379,http://localhost:2379"
ETCD_INITIAL_CLUSTER="mobvoi=http://10.1.204.164:2380,mobvoi=http://localhost:2380"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster"
ETCD_INITIAL_CLUSTER_STATE="new"
常用命令:
创建flannel网络
etcdctl mk /mobvoi/network/config '{"Network":"172.16.0.0/16","SubnetMin":"172.16.1.0","SubnetMax":"172.16.254.0"}'
etcdctl ls /mobvoi/network/subnets
2、flannel 安装及配置
[root@localhost ~]# cat /etc/sysconfig/flanneld
# Flanneld configuration options
# etcd url location. Point this to the server where etcd runs
FLANNEL_ETCD_ENDPOINTS="http://10.1.204.164:2379"
# etcd config key. This is the configuration key that flannel queries
# For address range assignment
FLANNEL_ETCD_PREFIX="/mobvoi/network"
# Any additional options that you want to pass
#FLANNEL_OPTIONS=""
systemctl restart flanneld
3、docker 配置
[root@localhost ~]# cat /usr/lib/systemd/system/docker.service|grep -Ev '^$|^#'
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
BindsTo=containerd.service
After=network-online.target firewalld.service containerd.service
Wants=network-online.target
Requires=docker.socket
[Service]
Type=notify
ExecStartPost=/usr/sbin/iptables -P FORWARD ACCEPT
ExecStart=/usr/bin/dockerd --bip=172.16.39.1/24 -H fd:// --containerd=/run/containerd/containerd.sock
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always
StartLimitBurst=3
StartLimitInterval=60s
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
Delegate=yes
KillMode=process
[Install]
WantedBy=multi-user.target