forked from pingcap/docs-tidb-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zh: update disaster recovery doc (pingcap#341)
* update disaster recovery doc * fix conflict
- Loading branch information
1 parent
df0be32
commit bf0f086
Showing
3 changed files
with
37 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
title: 恢复误删的 TiDB 集群 | ||
summary: 介绍如何恢复误删的 TiDB 集群。 | ||
category: how-to | ||
--- | ||
|
||
# 恢复误删的 TiDB 集群 | ||
|
||
本文介绍了如何恢复误删的 TiDB 集群。 | ||
|
||
## TidbCluster 管理的集群意外删除后恢复 | ||
|
||
TiDB Operator 使用 PV (Persistent Volume)、PVC (Persistent Volume Claim) 来存储持久化的数据,如果不小心使用 `kubectl delete tc` 意外删除了集群,PV/PVC 对象以及数据都会保留下来,以最大程度保证数据安全。 | ||
|
||
此时集群恢复的办法就是使用 `kubectl create` 命令来创建一个同名同配置的集群,之前保留下来未被删除的 PV/PVC 以及数据会被复用: | ||
|
||
{{< copyable "shell-regular" >}} | ||
|
||
```shell | ||
kubectl -n ${namespace} create -f tidb-cluster.yaml | ||
``` | ||
|
||
## Helm 管理的集群意外删除后恢复 | ||
|
||
TiDB Operator 使用 PV (Persistent Volume)、PVC (Persistent Volume Claim) 来存储持久化的数据,如果不小心使用 `helm delete` 意外删除了集群,PV/PVC 对象以及数据都会保留下来,以最大程度保证数据安全。 | ||
|
||
此时集群恢复的办法就是使用 `helm install` 命令来创建一个同名同配置的集群,之前保留下来未被删除的 PV/PVC 以及数据会被复用: | ||
|
||
{{< copyable "shell-regular" >}} | ||
|
||
```shell | ||
helm install pingcap/tidb-cluster -n ${release_name} --namespace=${namespace} --version=${chart_version} -f values.yaml | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters