Skip to content

Commit

Permalink
fix-pd-recover (#2475) (#2491)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Jan 19, 2024
1 parent 966ec7d commit 96f3ff9
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 @@ -201,14 +201,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 @@ -370,3 +363,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 @@ -201,14 +201,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 @@ -372,3 +365,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 96f3ff9

Please sign in to comment.