参考 Kubernetes 运行 etcd 集群
# 设置 etcd api 版本为 3
export ETCDCTL_API=3
### etcd 备份
# etcd 备份命令帮助 etcdctl snapshot save -h
# 如果 TLS 认证,需要指定相关证书
$etcdctl --endpoints=10.2.0.9:2379 --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key --cacert=/etc/kubernetes/pki/etcd/ca.crt snapshot save /backup/snapshot.db
### etcd 恢复
# etcd 恢复命令帮助 etcdctl snapshot restore -h
$etcdctl --endpoints=10.2.0.9:2379 --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key --cacert=/etc/kubernetes/pki/etcd/ca.crt snapshot restore /backup/snapshot.db
网友评论