主:
systemctl stop etcd
etcdctl backup --data-dir=/home/data --backup-dir=/home/etcd20181217
恢复:
1、复制数据,启动etcd
cp -r etcd20181217 /var/lib/etcd
etcd --data-dir=/var/lib/etcd --force-new-cluster
2、v2转v3
pkill etcd
export ETCDCTL_API=3
etcdctl migrate --data-dir /var/lib/etcd
systemctl start etcd
etcdctl get / --prefix --keys-only
已经显示数据
原文:http://blog.51cto.com/11578535/2331633