@@ -20,6 +20,21 @@ guide on a cluster with at least two nodes that are not acting as control plane
20
20
nodes. If you do not already have a cluster, you can create one by using
21
21
[ minikube] ( https://minikube.sigs.k8s.io/docs/tutorials/multi_node/ ) .
22
22
23
+ ### Understanding etcdctl and etcdutl
24
+
25
+ ` etcdctl ` and ` etcdutl ` are command-line tools used to interact with etcd clusters, but they serve different purposes:
26
+
27
+ - ` etcdctl ` : This is the primary command-line client for interacting with etcd over a
28
+ network. It is used for day-to-day operations such as managing keys and values,
29
+ administering the cluster, checking health, and more.
30
+
31
+ - ` etcdutl ` : This is an administration utility designed to operate directly on etcd data
32
+ files, including migrating data between etcd versions, defragmenting the database,
33
+ restoring snapshots, and validating data consistency. For network operations, ` etcdctl `
34
+ should be used.
35
+
36
+ For more information on ` etcdutl ` , you can refer to the [ etcd recovery documentation] ( https://etcd.io/docs/v3.5/op-guide/recovery/ ) .
37
+
23
38
<!-- steps -->
24
39
25
40
## Prerequisites
@@ -281,17 +296,54 @@ ETCDCTL_API=3 etcdctl --endpoints $ENDPOINT snapshot save snapshot.db
281
296
282
297
Verify the snapshot:
283
298
284
- ``` shell
285
- ETCDCTL_API=3 etcdctl --write-out=table snapshot status snapshot.db
286
- ```
299
+ {{< tabs name="etcd_verify_snapshot" >}}
300
+ {{% tab name="Use etcdutl" %}}
301
+ The below example depicts the usage of the ` etcdutl ` tool for verifying a snapshot:
287
302
288
- ``` console
289
- +----------+----------+------------+------------+
290
- | HASH | REVISION | TOTAL KEYS | TOTAL SIZE |
291
- +----------+----------+------------+------------+
292
- | fe01cf57 | 10 | 7 | 2.1 MB |
293
- +----------+----------+------------+------------+
294
- ```
303
+ ``` shell
304
+ etcdutl --write-out=table snapshot status snapshot.db
305
+ ```
306
+
307
+ This should generate an output resembling the example provided below:
308
+
309
+ ``` console
310
+ +----------+----------+------------+------------+
311
+ | HASH | REVISION | TOTAL KEYS | TOTAL SIZE |
312
+ +----------+----------+------------+------------+
313
+ | fe01cf57 | 10 | 7 | 2.1 MB |
314
+ +----------+----------+------------+------------+
315
+ ```
316
+
317
+ {{% /tab %}}
318
+ {{% tab name="Use etcdctl (Deprecated)" %}}
319
+
320
+ {{< note >}}
321
+ The usage of ` etcdctl snapshot status ` has been ** deprecated** since etcd v3.5.x and is slated for removal from etcd v3.6.
322
+ It is recommended to utilize [ ` etcdutl ` ] ( https://github.com/etcd-io/etcd/blob/main/etcdutl/README.md ) instead.
323
+ {{< /note >}}
324
+
325
+ The below example depicts the usage of the ` etcdctl ` tool for verifying a snapshot:
326
+
327
+ ``` shell
328
+ export ETCDCTL_API=3
329
+ etcdctl --write-out=table snapshot status snapshot.db
330
+ ```
331
+
332
+ This should generate an output resembling the example provided below:
333
+
334
+ ``` console
335
+ Deprecated: Use `etcdutl snapshot status` instead.
336
+
337
+ +----------+----------+------------+------------+
338
+ | HASH | REVISION | TOTAL KEYS | TOTAL SIZE |
339
+ +----------+----------+------------+------------+
340
+ | fe01cf57 | 10 | 7 | 2.1 MB |
341
+ +----------+----------+------------+------------+
342
+ ```
343
+
344
+
345
+ {{% /tab %}}
346
+ {{< /tabs >}}
295
347
296
348
### Volume snapshot
297
349
0 commit comments