Browse Source

Merge pull request #7022 from hongchaodeng/master

docs: explicitly set ETCDCTL_API=3 in recovery.md
Xiang Li 9 years ago
parent
commit
109577351b
1 changed files with 4 additions and 4 deletions
  1. 4 4
      Documentation/op-guide/recovery.md

+ 4 - 4
Documentation/op-guide/recovery.md

@@ -11,7 +11,7 @@ To recover from disastrous failure, etcd v3 provides snapshot and restore facili
 Recovering a cluster first needs a snapshot of the keyspace from an etcd member. A snapshot may either be taken from a live member with the `etcdctl snapshot save` command or by copying the `member/snap/db` file from an etcd data directory. For example, the following command snapshots the keyspace served by `$ENDPOINT` to the file `snapshot.db`:
 Recovering a cluster first needs a snapshot of the keyspace from an etcd member. A snapshot may either be taken from a live member with the `etcdctl snapshot save` command or by copying the `member/snap/db` file from an etcd data directory. For example, the following command snapshots the keyspace served by `$ENDPOINT` to the file `snapshot.db`:
 
 
 ```sh
 ```sh
-$ etcdctl --endpoints $ENDPOINT snapshot save snapshot.db
+$ ETCDCTL_API=3 etcdctl --endpoints $ENDPOINT snapshot save snapshot.db
 ```
 ```
 
 
 ### Restoring a cluster
 ### Restoring a cluster
@@ -23,17 +23,17 @@ Snapshot integrity may be optionally verified at restore time. If the snapshot i
 A restore initializes a new member of a new cluster, with a fresh cluster configuration using `etcd`'s cluster configuration flags, but preserves the contents of the etcd keyspace. Continuing from the previous example, the following creates new etcd data directories (`m1.etcd`, `m2.etcd`, `m3.etcd`) for a three member cluster:
 A restore initializes a new member of a new cluster, with a fresh cluster configuration using `etcd`'s cluster configuration flags, but preserves the contents of the etcd keyspace. Continuing from the previous example, the following creates new etcd data directories (`m1.etcd`, `m2.etcd`, `m3.etcd`) for a three member cluster:
 
 
 ```sh
 ```sh
-$ etcdctl snapshot restore snapshot.db \
+$ ETCDCTL_API=3 etcdctl snapshot restore snapshot.db \
   --name m1 \
   --name m1 \
   --initial-cluster m1=http:/host1:2380,m2=http://host2:2380,m3=http://host3:2380 \
   --initial-cluster m1=http:/host1:2380,m2=http://host2:2380,m3=http://host3:2380 \
   --initial-cluster-token etcd-cluster-1 \
   --initial-cluster-token etcd-cluster-1 \
   --initial-advertise-peer-urls http://host1:2380
   --initial-advertise-peer-urls http://host1:2380
-$ etcdctl snapshot restore snapshot.db \
+$ ETCDCTL_API=3 etcdctl snapshot restore snapshot.db \
   --name m2 \
   --name m2 \
   --initial-cluster m1=http:/host1:2380,m2=http://host2:2380,m3=http://host3:2380 \
   --initial-cluster m1=http:/host1:2380,m2=http://host2:2380,m3=http://host3:2380 \
   --initial-cluster-token etcd-cluster-1 \
   --initial-cluster-token etcd-cluster-1 \
   --initial-advertise-peer-urls http://host2:2380
   --initial-advertise-peer-urls http://host2:2380
-$ etcdctl snapshot restore snapshot.db \
+$ ETCDCTL_API=3 etcdctl snapshot restore snapshot.db \
   --name m3 \
   --name m3 \
   --initial-cluster m1=http:/host1:2380,m2=http://host2:2380,m3=http://host3:2380 \
   --initial-cluster m1=http:/host1:2380,m2=http://host2:2380,m3=http://host3:2380 \
   --initial-cluster-token etcd-cluster-1 \
   --initial-cluster-token etcd-cluster-1 \