etcd恢复备份-自己的研究做了改进成功了,官网的没成功不知道为何
2017-05-27 14:52
323 查看
因为在生产中直接拷贝DB比较方便且也比较符合生产中的实际情况,所以我用的是直接拷贝db数据的方式,所以恢复数据的时候加了参数 --skip-hash-check
恢复数据:
ETCDCTL_API=3 ./etcdctl snapshot restore ../db \
--name m1 \
--initial-cluster m1=http://192.168.75.145:2380,m2=http://192.168.75.145:3380,m3=http://192.168.75.145:4380 \
--initial-cluster-token etcd-cluster-1 \
--initial-advertise-peer-urls http://192.168.75.145:2380 \
--skip-hash-check
ETCDCTL_API=3 ./etcdctl snapshot restore ../db \
--name m2 \
--initial-cluster m1=http://192.168.75.145:2380,m2=http://192.168.75.145:3380,m3=http://192.168.75.145:4380 \
--initial-cluster-token etcd-cluster-1 \
--initial-advertise-peer-urls http://192.168.75.145:3380 \
--skip-hash-check
ETCDCTL_API=3 ./etcdctl snapshot restore ../db \
--name m3 \
--initial-cluster m1=http://192.168.75.145:2380,m2=http://192.168.75.145:3380,m3=http://192.168.75.145:4380 \
--initial-cluster-token etcd-cluster-1 \
--initial-advertise-peer-urls http://192.168.75.145:4380 \
--skip-hash-check
创建集群:(绿色的是官网的做法,一直没成功,执行etcdctl命令总是出现Error: grpc: timed out when dialing。实在没把发,我用了写出全部参数的方法成功)
./etcd \
--name m1 \
--listen-client-urls http://192.168.75.145:2379 \
--advertise-client-urls http://192.168.75.145:2379 \
--listen-peer-urls http://192.168.75.145:2380
./etcd --name m1 --initial-advertise-peer-urls http://192.168.75.145:2380 \
--listen-peer-urls http://192.168.75.145:2380 \
--listen-client-urls http://192.168.75.145:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://192.168.75.145:2379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster m1=http://192.168.75.145:2380,m2=http://192.168.75.145:3380,m3=http://192.168.75.145:4380 \
--initial-cluster-state new
./etcd \
--name m2 \
--listen-client-urls http://192.168.75.145:3379 \
--advertise-client-urls http://192.168.75.145:3379 \
--listen-peer-urls http://192.168.75.145:3380
./etcd --name m2 --initial-advertise-peer-urls http://192.168.75.145:3380 \
--listen-peer-urls http://192.168.75.145:3380 \
--listen-client-urls http://192.168.75.145:3379,http://127.0.0.1:3379 \
--advertise-client-urls http://192.168.75.145:3379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster m1=http://192.168.75.145:2380,m2=http://192.168.75.145:3380,m3=http://192.168.75.145:4380 \
--initial-cluster-state new
./etcd \
--name m3 \
--listen-client-urls http://192.168.75.145:4379 \
--advertise-client-urls http://192.168.75.145:4379 \
--listen-peer-urls http://192.168.75.145:4380
./etcd --name m3 --initial-advertise-peer-urls http://192.168.75.145:4380 \
--listen-peer-urls http://192.168.75.145:4380 \
--listen-client-urls http://192.168.75.145:4379,http://127.0.0.1:4379 \
--advertise-client-urls http://192.168.75.145:4379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster m1=http://192.168.75.145:2380,m2=http://192.168.75.145:3380,m3=http://192.168.75.145:4380 \
--initial-cluster-state new
恢复数据:
ETCDCTL_API=3 ./etcdctl snapshot restore ../db \
--name m1 \
--initial-cluster m1=http://192.168.75.145:2380,m2=http://192.168.75.145:3380,m3=http://192.168.75.145:4380 \
--initial-cluster-token etcd-cluster-1 \
--initial-advertise-peer-urls http://192.168.75.145:2380 \
--skip-hash-check
ETCDCTL_API=3 ./etcdctl snapshot restore ../db \
--name m2 \
--initial-cluster m1=http://192.168.75.145:2380,m2=http://192.168.75.145:3380,m3=http://192.168.75.145:4380 \
--initial-cluster-token etcd-cluster-1 \
--initial-advertise-peer-urls http://192.168.75.145:3380 \
--skip-hash-check
ETCDCTL_API=3 ./etcdctl snapshot restore ../db \
--name m3 \
--initial-cluster m1=http://192.168.75.145:2380,m2=http://192.168.75.145:3380,m3=http://192.168.75.145:4380 \
--initial-cluster-token etcd-cluster-1 \
--initial-advertise-peer-urls http://192.168.75.145:4380 \
--skip-hash-check
创建集群:(绿色的是官网的做法,一直没成功,执行etcdctl命令总是出现Error: grpc: timed out when dialing。实在没把发,我用了写出全部参数的方法成功)
./etcd \
--name m1 \
--listen-client-urls http://192.168.75.145:2379 \
--advertise-client-urls http://192.168.75.145:2379 \
--listen-peer-urls http://192.168.75.145:2380
./etcd --name m1 --initial-advertise-peer-urls http://192.168.75.145:2380 \
--listen-peer-urls http://192.168.75.145:2380 \
--listen-client-urls http://192.168.75.145:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://192.168.75.145:2379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster m1=http://192.168.75.145:2380,m2=http://192.168.75.145:3380,m3=http://192.168.75.145:4380 \
--initial-cluster-state new
./etcd \
--name m2 \
--listen-client-urls http://192.168.75.145:3379 \
--advertise-client-urls http://192.168.75.145:3379 \
--listen-peer-urls http://192.168.75.145:3380
./etcd --name m2 --initial-advertise-peer-urls http://192.168.75.145:3380 \
--listen-peer-urls http://192.168.75.145:3380 \
--listen-client-urls http://192.168.75.145:3379,http://127.0.0.1:3379 \
--advertise-client-urls http://192.168.75.145:3379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster m1=http://192.168.75.145:2380,m2=http://192.168.75.145:3380,m3=http://192.168.75.145:4380 \
--initial-cluster-state new
./etcd \
--name m3 \
--listen-client-urls http://192.168.75.145:4379 \
--advertise-client-urls http://192.168.75.145:4379 \
--listen-peer-urls http://192.168.75.145:4380
./etcd --name m3 --initial-advertise-peer-urls http://192.168.75.145:4380 \
--listen-peer-urls http://192.168.75.145:4380 \
--listen-client-urls http://192.168.75.145:4379,http://127.0.0.1:4379 \
--advertise-client-urls http://192.168.75.145:4379 \
--initial-cluster-token etcd-cluster-1 \
--initial-cluster m1=http://192.168.75.145:2380,m2=http://192.168.75.145:3380,m3=http://192.168.75.145:4380 \
--initial-cluster-state new
相关文章推荐
- 注册表故障恢复 必须使用记录或另一备份以恢复包含系统注册表数据的文件。恢复成功
- Oracle数据库的备份及恢复策略研究
- 有关puppet agent端三种备份恢复方案探讨研究 推荐
- etcd 备份与恢复
- SVN搭建(以此为准,成功)文后含备份与恢复
- 使用了博客园的备份后得到一个xml文件,不知道有没有css或者xslt文件可以在本地阅读文章,在网上找了半天也没有找到解决办法,难道要自己写?
- 突然想要做个新闻内容的分页,网上查了下资料,找到了一个可以用的类(代码需要自己研究下,我已经试验成功了)
- [更新][自己的blog]解决"恢复SPS2003备份,遇到“数据库架构太旧”的提示而无法执行恢复。"
- Oracle数据库的备份及恢复策略研究
- 怎么给自己系统做备份与恢复(ghost)
- Postgresql 备份与恢复研究
- 反正都是写代码,为了赚钱。为何不尝试自己找project来做。尝试,不一定要成功。
- 第二章 数据备份和恢复技术 --基于mkCDrec的核心网网络运维系统的备份和恢复的研究与实现
- Oracle数据库的备份及恢复策略研究
- [转载]所有控制文件损坏,掉电(shutdown abort),无归档,无备份的成功恢复(www.itpub.net)
- 摘要目录 --基于mkCDrec的核心网网络运维系统的备份和恢复的研究与实现
- app备份与恢复研究
- 必须使用记录或另一备份以恢复包含系统注册数据的文件.恢复成功(已解决)
- weblogic AS和ms的备份和恢复的研究
- 自己搞mysql簇备份与恢复的血史 推荐