Skip to content

Commit

Permalink
fix-pd-recover (#2475)
Browse files Browse the repository at this point in the history
  • Loading branch information
yiduoyunQ authored Jan 19, 2024
1 parent 1d5961a commit c9ecd26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
11 changes: 3 additions & 8 deletions en/pd-recover.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,7 @@ Check configuration. The following command uses placement rules as an example:
kubectl -n ${namespace} exec -it ${cluster_name}-pd-0 -- ./pd-ctl config placement-rules show
```

### Step 6. Restart TiDB and TiKV

Use the following commands to restart the TiDB and TiKV clusters:

```shell
kubectl delete pod -l app.kubernetes.io/component=tidb,app.kubernetes.io/instance=${cluster_name} -n ${namespace} &&
kubectl delete pod -l app.kubernetes.io/component=tikv,app.kubernetes.io/instance=${cluster_name} -n ${namespace}
```
Now the TiDB cluster is recovered.

## Scenarios 2: All PD nodes are down and cannot be recovered

Expand Down Expand Up @@ -371,3 +364,5 @@ Use the following commands to restart the TiDB and TiKV clusters:
kubectl delete pod -l app.kubernetes.io/component=tidb,app.kubernetes.io/instance=${cluster_name} -n ${namespace} &&
kubectl delete pod -l app.kubernetes.io/component=tikv,app.kubernetes.io/instance=${cluster_name} -n ${namespace}
```

Now the TiDB cluster is recovered.
11 changes: 3 additions & 8 deletions zh/pd-recover.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,7 @@ kubectl -n ${namespace} exec -it ${cluster_name}-pd-0 -- ./pd-ctl health
kubectl -n ${namespace} exec -it ${cluster_name}-pd-0 -- ./pd-ctl config placement-rules show
```

### 第 6 步:重启 TiDB 和 TiKV

使用以下命令重启 TiDB 和 TiKV 实例:

```shell
kubectl delete pod -l app.kubernetes.io/component=tidb,app.kubernetes.io/instance=${cluster_name} -n ${namespace} &&
kubectl delete pod -l app.kubernetes.io/component=tikv,app.kubernetes.io/instance=${cluster_name} -n ${namespace}
```
至此服务恢复。

## 场景 2:所有 PD 节点都故障且无法恢复

Expand Down Expand Up @@ -373,3 +366,5 @@ kubectl patch tc ${cluster_name} -n ${namespace} --type merge -p '{"spec":{"pd":
kubectl delete pod -l app.kubernetes.io/component=tidb,app.kubernetes.io/instance=${cluster_name} -n ${namespace} &&
kubectl delete pod -l app.kubernetes.io/component=tikv,app.kubernetes.io/instance=${cluster_name} -n ${namespace}
```

至此服务恢复。

0 comments on commit c9ecd26

Please sign in to comment.