## master安装etcd
cd /usr/local/share
rz
tar -zvxf etcd-v3.4.13-linux-amd64.tar.gz
rm -f etcd-v3.4.13-linux-amd64.tar.gz
vi /etc/profile
export ETCD_HOME=/usr/local/share/etcd-v3.4.13-linux-amd64
export PATH=$ETCD_HOME:$PATH
source /etc/profile
etcd -v
## 编写脚本(脚本内容见最底部)
mkdir -p /var/etcd-sh
cd /var/etcd-sh
rz
# etcd-backup.sh
# etcd-restore.sh
chmod u+x /var/etcd-sh/*.sh
/var/etcd-sh/etcd-backup.sh
## 配置定时任务
crontab -e
*/60 * * * * /var/etcd-sh/etcd-backup.sh
# 验证恢复
## 停止etcd、apiserver服务
mv /etc/kubernetes/manifests/etcd.yaml /tmp/
mv /etc/kubernetes/manifests/kube-apiserver.yaml /tmp/
docker ps |grep etcd
docker ps |grep apiserver
<