Quentin-M / etcd-cloud-operator

Deploying and managing production-grade etcd clusters on cloud providers: failure recovery, disaster recovery, backups and resizing.
Apache License 2.0
233 stars 42 forks source link

Refactor server.Restore to use etcd/clientv3/snapshot #57

Closed mitchellhuang closed 3 years ago

Quentin-M commented 3 years ago

clean, and easy!

Quentin-M commented 3 years ago

@mitchellhuang did you test restoration yet, from 0 instance back to 3?

mitchellhuang commented 3 years ago

@Quentin-M confirmed working on sandbox, should be good to merge

core@ip-10-17-67-76 ~ $ docker ps
CONTAINER ID        IMAGE                                               COMMAND                  CREATED             STATUS              PORTS               NAMES
3f4d54e62c31        quay.io/mitchellhuang/etcd-cloud-operator:v3.4.14   "/operator -config /…"   About an hour ago   Up About an hour                        eco
e6420ce1711d        quay.io/prometheus/node-exporter:v0.17.0            "/bin/node_exporter"     About an hour ago   Up About an hour                        node-exporter
core@ip-10-17-67-76 ~ $ journalctl -u eco
Oct 05 19:49:29 ip-10-17-67-76 docker[3762]: time="2020-10-05T19:49:29Z" level=info msg="restoring snapshot \"i-0ccfc562ee58ebbf1_0000000000557690_etcd.backup\" (rev: 0000000000557690, size: 19.660 MB)"
Oct 05 19:49:30 ip-10-17-67-76 docker[3762]: 1.601927370447812e+09        info        snapshot/v3_snapshot.go:296        restoring snapshot        {"path": "/tmp/542634791", "wal-dir": "/var/lib/eco/etcd/member/wal", "data-dir": "/var/lib/eco/etcd", "snap-dir": "/var/lib/eco/etcd/member/snap"}
Oct 05 19:49:30 ip-10-17-67-76 docker[3762]: 1.601927370961172e+09        info        snapshot/v3_snapshot.go:309        restored snapshot        {"path": "/tmp/542634791", "wal-dir": "/var/lib/eco/etcd/member/wal", "data-dir": "/var/lib/eco/etcd", "snap-dir": "/var/lib/eco/etcd/member/snap"}