Skip to content

Commit 2668fec

Browse files
authored
Merge pull request #42131 from mrgiles/36784_etcd_restore_cmd_update
Add note after restore cmd to specify that data-dir will be (re)created
2 parents 70dd4bd + 59eff87 commit 2668fec

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

content/en/docs/tasks/administer-cluster/configure-upgrade-etcd.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -275,16 +275,16 @@ that is not currently used by an etcd process. Taking the snapshot will
275275
not affect the performance of the member.
276276

277277
Below is an example for taking a snapshot of the keyspace served by
278-
`$ENDPOINT` to the file `snapshotdb`:
278+
`$ENDPOINT` to the file `snapshot.db`:
279279

280280
```shell
281-
ETCDCTL_API=3 etcdctl --endpoints $ENDPOINT snapshot save snapshotdb
281+
ETCDCTL_API=3 etcdctl --endpoints $ENDPOINT snapshot save snapshot.db
282282
```
283283

284284
Verify the snapshot:
285285

286286
```shell
287-
ETCDCTL_API=3 etcdctl --write-out=table snapshot status snapshotdb
287+
ETCDCTL_API=3 etcdctl --write-out=table snapshot status snapshot.db
288288
```
289289

290290
```console
@@ -343,19 +343,25 @@ employed to recover the data of a failed cluster.
343343
Before starting the restore operation, a snapshot file must be present. It can
344344
either be a snapshot file from a previous backup operation, or from a remaining
345345
[data directory](https://etcd.io/docs/current/op-guide/configuration/#--data-dir).
346+
346347
Here is an example:
347348

348349
```shell
349-
ETCDCTL_API=3 etcdctl --endpoints 10.2.0.9:2379 snapshot restore snapshotdb
350+
ETCDCTL_API=3 etcdctl --endpoints 10.2.0.9:2379 snapshot restore snapshot.db
350351
```
351-
Another example for restoring using etcdctl options:
352+
353+
Another example for restoring using `etcdctl` options:
354+
352355
```shell
353-
ETCDCTL_API=3 etcdctl snapshot restore --data-dir <data-dir-location> snapshotdb
356+
ETCDCTL_API=3 etcdctl --data-dir <data-dir-location> snapshot restore snapshot.db
354357
```
355-
Yet another example would be to first export the environment variable
358+
where `<data-dir-location>` is a directory that will be created during the restore process.
359+
360+
Yet another example would be to first export the `ETCDCTL_API` environment variable:
361+
356362
```shell
357363
export ETCDCTL_API=3
358-
etcdctl snapshot restore --data-dir <data-dir-location> snapshotdb
364+
etcdctl --data-dir <data-dir-location> snapshot restore snapshot.db
359365
```
360366

361367
For more information and examples on restoring a cluster from a snapshot file, see

0 commit comments

Comments
 (0)