etcdutl - etcd offline utility: works on snapshot files and data directories
etcdutl snapshot status|restore FILE [flags]
Options you will use
snapshot status FILE [-w table]- hash, revision, total keys, size, version
snapshot restore FILE --data-dir DIR- build a NEW data directory from the snapshot (DIR must not exist or be empty)
--name, --initial-cluster, --initial-advertise-peer-urls- member identity for multi-member restores
Examples
$ sudo etcdutl snapshot restore /backup/etcd.db --data-dir /var/lib/etcd-restorethen point the etcd static pod's hostPath at /var/lib/etcd-restore
Gotchas
- Without --data-dir it restores into ./default.etcd in the current directory.
- Restoring into the live /var/lib/etcd fails: "data-dir ... not empty or could not be read". Use a new dir and switch the manifest.
Taught in
Try etcdutl in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.