@@ -22,8 +22,6 @@ content_type: task
22
22
23
23
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
24
24
25
-
26
-
27
25
<!-- steps -->
28
26
29
27
<!--
@@ -77,7 +75,7 @@ Before deploying etcd in production, see
77
75
78
76
## Starting etcd clusters
79
77
80
- This section covers starting a single-node and multi-node etcd cluster.
78
+ This section covers starting a single-node and multi-node etcd cluster.
81
79
-->
82
80
## 资源要求
83
81
@@ -104,7 +102,7 @@ Use a single-node etcd cluster only for testing purpose.
104
102
2. Start the Kubernetes API server with the flag
105
103
`--etcd-servers=$PRIVATE_IP:2379`.
106
104
107
- Make sure `PRIVATE_IP` is set to your etcd client IP.
105
+ Make sure `PRIVATE_IP` is set to your etcd client IP.
108
106
-->
109
107
### 单节点 etcd 集群
110
108
@@ -236,8 +234,8 @@ communication:
236
234
237
235
```
238
236
ETCDCTL_API=3 etcdctl --endpoints 10.2.0.9:2379 \
239
- --cert=/etc/kubernetes/pki/etcd/client .crt \
240
- --key=/etc/kubernetes/pki/etcd/client .key \
237
+ --cert=/etc/kubernetes/pki/etcd/server .crt \
238
+ --key=/etc/kubernetes/pki/etcd/server .key \
241
239
--cacert=/etc/kubernetes/pki/etcd/ca.crt \
242
240
member list
243
241
```
@@ -253,8 +251,8 @@ ETCDCTL_API=3 etcdctl --endpoints 10.2.0.9:2379 \
253
251
254
252
```
255
253
ETCDCTL_API=3 etcdctl --endpoints 10.2.0.9:2379 \
256
- --cert=/etc/kubernetes/pki/etcd/client .crt \
257
- --key=/etc/kubernetes/pki/etcd/client .key \
254
+ --cert=/etc/kubernetes/pki/etcd/server .crt \
255
+ --key=/etc/kubernetes/pki/etcd/server .key \
258
256
--cacert=/etc/kubernetes/pki/etcd/ca.crt \
259
257
member list
260
258
```
@@ -274,7 +272,7 @@ access to clients with the certificate `k8sclient.cert`.
274
272
275
273
Once etcd is configured correctly, only clients with valid certificates can
276
274
access it. To give Kubernetes API servers the access, configure them with the
277
- flags `--etcd-certfile=k8sclient.cert`,`--etcd-keyfile=k8sclient.key` and
275
+ flags `--etcd-certfile=k8sclient.cert`, `--etcd-keyfile=k8sclient.key` and
278
276
`--etcd-cafile=ca.cert`.
279
277
280
278
{{< note >}}
@@ -292,7 +290,7 @@ information, see the related issue
292
290
指定参数 ` --client-cert-auth=true ` 和 ` --trusted-ca-file=etcd.ca ` 将限制对具有证书 ` k8sclient.cert ` 的客户端的访问。
293
291
294
292
一旦正确配置了 etcd,只有具有有效证书的客户端才能访问它。要让 Kubernetes API 服务器访问,
295
- 可以使用参数 ` --etcd-certfile=k8sclient.cert ` ,` --etcd-keyfile=k8sclient.key ` 和 ` --etcd-cafile=ca.cert ` 配置。
293
+ 可以使用参数 ` --etcd-certfile=k8sclient.cert ` , ` --etcd-keyfile=k8sclient.key ` 和 ` --etcd-cafile=ca.cert ` 配置。
296
294
297
295
{{< note >}}
298
296
Kubernetes 目前不支持 etcd 身份验证。
@@ -593,12 +591,16 @@ employed to recover the data of a failed cluster.
593
591
594
592
Before starting the restore operation, a snapshot file must be present. It can
595
593
either be a snapshot file from a previous backup operation, or from a remaining
596
- [data directory]( https://etcd.io/docs/current/op-guide/configuration/#--data-dir).
594
+ [data directory](https://etcd.io/docs/current/op-guide/configuration/#--data-dir).
597
595
Here is an example:
598
596
599
597
```shell
600
598
ETCDCTL_API=3 etcdctl --endpoints 10.2.0.9:2379 snapshot restore snapshotdb
601
599
```
600
+ Another example for restoring using etcdctl options:
601
+ ```shell
602
+ ETCDCTL_API=3 etcdctl --data-dir <data-dir-location> snapshot restore snapshotdb
603
+ ```
602
604
603
605
For more information and examples on restoring a cluster from a snapshot file, see
604
606
[etcd disaster recovery documentation](https://etcd.io/docs/current/op-guide/recovery/#restoring-a-cluster).
@@ -638,15 +640,14 @@ etcd 支持从 [major.minor](http://semver.org/) 或其他不同 patch 版本的
638
640
还原操作用于恢复失败的集群的数据。
639
641
640
642
在启动还原操作之前,必须有一个快照文件。它可以是来自以前备份操作的快照文件,
641
- 也可以是来自剩余[ 数据目录] ( https://etcd.io/docs/current/op-guide/configuration/#--data-dir ) 的快照文件。
643
+ 也可以是来自剩余[ 数据目录] ( https://etcd.io/docs/current/op-guide/configuration/#--data-dir ) 的快照文件。
642
644
例如:
643
645
644
646
``` shell
645
647
ETCDCTL_API=3 etcdctl --endpoints 10.2.0.9:2379 snapshot restore snapshotdb
646
648
```
647
649
648
650
恢复时也可以指定操作选项,例如:
649
-
650
651
```
651
652
ETCDCTL_API=3 etcdctl --data-dir <data-dir-location> snapshot restore snapshotdb
652
653
```
@@ -674,9 +675,9 @@ ETCDCTL_API=3 etcdctl --data-dir <data-dir-location> snapshot restore snapshotdb
674
675
{{< /note >}}
675
676
676
677
<!--
677
-
678
678
## Upgrading etcd clusters
679
679
680
+
680
681
For more details on etcd upgrade, please refer to the [etcd upgrades](https://etcd.io/docs/latest/upgrades/) documentation.
681
682
682
683
{{< note >}}
0 commit comments