Merge pull request #1050 from Felixnoo/translation-update-26

Cluster Shutdown and Restart ZH reviewed.
This commit is contained in:
Sherlock113 2021-02-01 20:47:04 +08:00 committed by GitHub
commit e7e487bb41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 26 deletions

View File

@ -50,7 +50,7 @@ You have shut down your cluster gracefully.
{{< notice tip >}}
Usually, a cluster can be used after restarting, but the cluster may be unavailable due to unexpected conditions. For example:
- Etcd data corruption during the shutdown.
- etcd data corruption during the shutdown.
- Node failures.
- Unexpected network errors.

View File

@ -1,6 +1,6 @@
---
title: "关闭和重启集群"
description: "Demonstrate how to shut down and restart Kubernetes clusters gracefully"
description: "演示如何平稳地关闭和重启 Kubernetes 集群"
layout: "single"
linkTitle: "关闭和重启集群"
@ -9,33 +9,33 @@ weight: 8800
icon: "/images/docs/docs.svg"
---
出于维护原因,您可能需要临时关闭群集。本文档介绍了正常关闭集群的过程以及如何重新启动集群。
您可能需要临时关闭集群进行维护。本文介绍平稳关闭集群的流程以及如何重新启动集群。
{{< notice warning >}}
关闭群集非常危险。 您必须完全了解所做的操作及其后果。 请先进行etcd备份然后再继续。 通常建议一 一维护您的节点,而不是重新启动整个集群。
关闭集群是非常危险的操作。您必须完全了解该操作及其后果。请先进行 etcd 备份,然后再继续。通常情况下,建议您逐个维护节点,而不是重新启动整个集群。
{{</ notice >}}
## 前提条件
## 准备工作
- 关闭群集之前,请先进行[etcd备份](https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/recovery.md#snapshotting-the-keyspace)。
- 主机之间设置了SSH[免密登录](https://man.openbsd.org/ssh.1#AUTHENTICATION)。
- 请先进行 [etcd 备份](https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/recovery.md#snapshotting-the-keyspace),再关闭集群
- 主机之间已设置 SSH [免密登录](https://man.openbsd.org/ssh.1#AUTHENTICATION)。
## 关闭集群
{{< notice tip >}}
- 关闭群集之前必须备份etcd数据因为如果在重新启动群集时遇到任何问题则可以通过etcd还原群集
- 使用本教程中的方法可以正常关闭集群,而数据损坏的可能性仍然存在。
- 关闭集群前,请您务必备份 etcd 数据,以便在重新启动群集时如果遇到任何问题,可以通过 etcd 还原集群
- 使用本教程中的方法可以平稳关闭集群,但数据损坏的可能性仍然存在。
{{</ notice >}}
### 步骤 1: 获取节点列表
### 步骤 1获取节点列表
```bash
nodes=$(kubectl get nodes -o name)
```
### 步骤 2: 关闭所有节点
### 步骤 2关闭所有节点
```bash
for node in ${nodes[@]}
@ -45,45 +45,45 @@ do
done
```
然后,您可以关闭其他群依赖项,例如外部存储。
然后,您可以关闭其他的集群依赖项,例如外部存储。
## 正常重启群集
## 平稳重启集群
在正常关闭集群后,可以正常重启集群。
平稳关闭集群后,您可以平稳重启集群。
### 前提条件
### 准备工作
您已正常关闭集群。
您已平稳关闭集群。
{{< notice tip >}}
大多数情况下,重新启动集群后可以继续正常使用,但是由于意外情况,该集群可能不可用。 例如:
通常情况下,重新启动集群后可以继续正常使用,但是由于意外情况,该集群可能不可用。例如:
- 关闭期间Etcd数据损坏。
- 关闭集群过程中 etcd 数据损坏。
- 节点故障。
- 不可预期的网络错误。
{{</ notice >}}
### 步骤 1: 检查所有群集依赖项的状态
### 步骤 1:检查所有集群依赖项的状态
确保所有集依赖项均已就绪,例如外部存储。
确保所有集依赖项均已就绪,例如外部存储。
### 步骤 2: 打开集群主机电源
### 步骤 2打开集群主机电源
等待集群启动并运行这可能需要大约10分钟。
等待集群启动并运行,这可能需要大约 10 分钟。
### 步骤 3: 检查所有主节点的状态
### 步骤 3检查所有主节点的状态
检查核心组件例如etcd服务的状态并确保一切就绪。
检查核心组件(例如 etcd 服务)的状态,并确保一切就绪。
```bash
kubectl get nodes -l node-role.kubernetes.io/master
```
### 步骤 4: 检查所有工作节点的状态
### 步骤 4检查所有工作节点的状态
```bash
kubectl get nodes -l node-role.kubernetes.io/worker
```
如果您的集群重启失败,请尝试[恢复etcd集群](https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/recovery.md#restoring-a-cluster)。
如果您的集群重启失败,请尝试[恢复 etcd 集群](https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/recovery.md#restoring-a-cluster)。