Skip to content

Commit 5c1e172

Browse files
authored
Merge pull request #34898 from windsonsea/zookeep
[zh-cn] updated /tutorials/stateful-application/zookeeper.md
2 parents 116b6bc + 8a59f9e commit 5c1e172

File tree

1 file changed

+20
-22
lines changed
  • content/zh-cn/docs/tutorials/stateful-application

1 file changed

+20
-22
lines changed

content/zh-cn/docs/tutorials/stateful-application/zookeeper.md

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ quorum。
122122
<!--
123123
ZooKeeper servers keep their entire state machine in memory, and write every mutation to a durable WAL (Write Ahead Log) on storage media. When a server crashes, it can recover its previous state by replaying the WAL. To prevent the WAL from growing without bound, ZooKeeper servers will periodically snapshot them in memory state to storage media. These snapshots can be loaded directly into memory, and all WAL entries that preceded the snapshot may be discarded.
124124
-->
125-
ZooKeeper 在内存中保存它们的整个状态机,但是每个改变都被写入一个在存储介质上的
126-
持久 WAL(Write Ahead Log)。
125+
ZooKeeper 在内存中保存它们的整个状态机,但是每个改变都被写入一个在存储介质上的持久
126+
WAL(Write Ahead Log)。
127127
当一个服务器出现故障时,它能够通过回放 WAL 恢复之前的状态。
128128
为了防止 WAL 无限制的增长,ZooKeeper 服务器会定期的将内存状态快照保存到存储介质。
129129
这些快照能够直接加载到内存中,所有在这个快照之前的 WAL 条目都可以被安全的丢弃。
@@ -139,10 +139,9 @@ and a [StatefulSet](/docs/concepts/workloads/controllers/statefulset/).
139139
-->
140140
## 创建一个 ZooKeeper Ensemble
141141

142-
下面的清单包含一个
143-
[无头服务](/zh-cn/docs/concepts/services-networking/service/#headless-services)
144-
一个 [Service](/zh-cn/docs/concepts/services-networking/service/)
145-
一个 [PodDisruptionBudget](/zh-cn/docs/concepts/workloads/pods/disruptions/#specifying-a-poddisruptionbudget)
142+
下面的清单包含一个[无头服务](/zh-cn/docs/concepts/services-networking/service/#headless-services)
143+
一个 [Service](/zh-cn/docs/concepts/services-networking/service/)
144+
一个 [PodDisruptionBudget](/zh-cn/docs/concepts/workloads/pods/disruptions/#specifying-a-poddisruptionbudget)
146145
和一个 [StatefulSet](/zh-cn/docs/concepts/workloads/controllers/statefulset/)
147146

148147
{{< codenew file="application/zookeeper/zookeeper.yaml" >}}
@@ -180,7 +179,7 @@ StatefulSet controller create the StatefulSet's Pods.
180179
-->
181180
使用命令
182181
[`kubectl get`](/docs/reference/generated/kubectl/kubectl-commands/#get)
183-
查看 StatefulSet 控制器创建的 Pods
182+
查看 StatefulSet 控制器创建的几个 Pod
184183

185184
```shell
186185
kubectl get pods -w -l app=zk
@@ -215,7 +214,7 @@ The StatefulSet controller creates three Pods, and each Pod has a container with
215214
a [ZooKeeper](https://www-us.apache.org/dist/zookeeper/stable/) server.
216215
-->
217216
StatefulSet 控制器创建 3 个 Pod,每个 Pod 包含一个
218-
[ZooKeeper](https://www-us.apache.org/dist/zookeeper/stable/) 服务容器。
217+
[ZooKeeper](https://archive.apache.org/dist/zookeeper/stable/) 服务容器。
219218

220219
<!--
221220
### Facilitating Leader Election
@@ -295,7 +294,7 @@ for i in 0 1 2; do kubectl exec zk-$i -- hostname -f; done
295294
The `zk-hs` Service creates a domain for all of the Pods,
296295
`zk-hs.default.svc.cluster.local`.
297296
-->
298-
`zk-hs` Service 为所有 Pods 创建了一个域:`zk-hs.default.svc.cluster.local`
297+
`zk-hs` Service 为所有 Pod 创建了一个域:`zk-hs.default.svc.cluster.local`
299298

300299
```
301300
zk-0.zk-hs.default.svc.cluster.local
@@ -310,7 +309,7 @@ ZooKeeper stores its application configuration in a file named `zoo.cfg`. Use `k
310309
-->
311310
[Kubernetes DNS](/zh-cn/docs/concepts/services-networking/dns-pod-service/)
312311
中的 A 记录将 FQDN 解析成为 Pod 的 IP 地址。
313-
如果 Pods 被调度,这个 A 记录将会使用 Pods 的新 IP 地址完成更新,
312+
如果 Kubernetes 重新调度这些 Pod,这个 A 记录将会使用这些 Pod 的新 IP 地址完成更新,
314313
但 A 记录的名称不会改变。
315314

316315
ZooKeeper 在一个名为 `zoo.cfg` 的文件中保存它的应用配置。
@@ -389,10 +388,9 @@ the FQDNs of the ZooKeeper servers will resolve to a single endpoint, and that
389388
endpoint will be the unique ZooKeeper server claiming the identity configured
390389
in its `myid` file.
391390
-->
392-
每个 Pod 的 A 记录仅在 Pod 变成 Ready状态时被录入
391+
每个 Pod 的 A 记录仅在 Pod 变成 Ready 状态时被录入
393392
因此,ZooKeeper 服务器的 FQDN 只会解析到一个端点,
394-
而那个端点将会是一个唯一的 ZooKeeper 服务器,
395-
这个服务器声明了配置在它的 `myid` 文件中的标识符。
393+
而那个端点将是申领其 `myid` 文件中所配置标识的唯一 ZooKeeper 服务器。
396394

397395
```
398396
zk-0.zk-hs.default.svc.cluster.local
@@ -699,7 +697,7 @@ Get the `zk` StatefulSet.
699697
-->
700698
## 确保一致性配置
701699

702-
如同在[促成领导者选举](#facilitating-leader-election) [达成一致](#achieving-consensus)
700+
如同在[促成领导者选举](#facilitating-leader-election)[达成一致](#achieving-consensus)
703701
小节中提到的,ZooKeeper ensemble 中的服务器需要一致性的配置来选举一个领导者并形成一个
704702
quorum。它们还需要 Zab 协议的一致性配置来保证这个协议在网络中正确的工作。
705703
在这次的示例中,我们通过直接将配置写入代码清单中来达到该目的。
@@ -753,8 +751,8 @@ Use the command below to get the logging configuration from one of Pods in the `
753751
### 配置日志 {#configuring-logging}
754752

755753
`zkGenConfig.sh` 脚本产生的一个文件控制了 ZooKeeper 的日志行为。
756-
ZooKeeper 使用了 [Log4j](http://logging.apache.org/log4j/2.x/) 并默认使用
757-
基于文件大小和时间的滚动文件追加器作为日志配置
754+
ZooKeeper 使用了 [Log4j](http://logging.apache.org/log4j/2.x/)
755+
并默认使用基于文件大小和时间的滚动文件追加器作为日志配置
758756

759757
`zk` StatefulSet 的一个 Pod 中获取日志配置。
760758

@@ -788,8 +786,8 @@ Use [`kubectl logs`](/docs/reference/generated/kubectl/kubectl-commands/#logs) t
788786
-->
789787
这是在容器里安全记录日志的最简单的方法。
790788
由于应用的日志被写入标准输出,Kubernetes 将会为你处理日志轮转。
791-
Kubernetes 还实现了一个智能保存策略,保证写入标准输出和标准错误流
792-
的应用日志不会耗尽本地存储媒介
789+
Kubernetes 还实现了一个智能保存策略,
790+
保证写入标准输出和标准错误流的应用日志不会耗尽本地存储介质
793791

794792
使用命令 [`kubectl logs`](/docs/reference/generated/kubectl/kubectl-commands/#logs)
795793
从一个 Pod 中取回最后 20 行日志。
@@ -869,7 +867,7 @@ corresponds to the zookeeper group.
869867
870868
Get the ZooKeeper process information from the `zk-0` Pod.
871869
-->
872-
Pods 的容器内部,UID 1000 对应用户 zookeeper,GID 1000 对应用户组 zookeeper。
870+
Pod 的容器内部,UID 1000 对应用户 zookeeper,GID 1000 对应用户组 zookeeper。
873871

874872
从 `zk-0` Pod 获取 ZooKeeper 进程信息。
875873

@@ -1075,7 +1073,7 @@ In another terminal, terminate the ZooKeeper process in Pod `zk-0` with the foll
10751073
The termination of the ZooKeeper process caused its parent process to terminate. Because the `RestartPolicy` of the container is Always, it restarted the parent process.
10761074
-->
10771075
ZooKeeper 进程的终结导致了它父进程的终止。由于容器的 `RestartPolicy`
1078-
是 Always,父进程被重启
1076+
是 Always,所以父进程被重启
10791077

10801078
```
10811079
NAME READY STATUS RESTARTS AGE
@@ -1257,7 +1255,7 @@ the clients of your ZooKeeper service will experience an outage until at least o
12571255
默认情况下,Kubernetes 可以把 `StatefulSet` 的 Pod 部署在相同节点上。
12581256
对于你创建的 3 个服务器的 ensemble 来说,
12591257
如果有两个服务器并存于相同的节点上并且该节点发生故障时,ZooKeeper 服务将中断,
1260-
直至至少一个 Pods 被重新调度。
1258+
直至至少其中一个 Pod 被重新调度。
12611259

12621260
<!--
12631261
You should always provision additional capacity to allow the processes of critical
@@ -1698,6 +1696,6 @@ You should always allocate additional capacity for critical services so that the
16981696
and provisioning method, to ensure that all storage is reclaimed.
16991697
-->
17001698
* 使用 `kubectl uncordon` 解除你集群中所有节点的隔离。
1701-
* 你需要删除在本教程中使用的 PersistentVolume 的持久存储媒介
1699+
* 你需要删除在本教程中使用的 PersistentVolume 的持久存储介质
17021700
请遵循必须的步骤,基于你的环境、存储配置和制备方法,保证回收所有的存储。
17031701

0 commit comments

Comments
 (0)