Skip to content

Commit

Permalink
en: reorg the disaster recovery part (pingcap#467)
Browse files Browse the repository at this point in the history
Co-authored-by: DanielZhangQD <[email protected]>
  • Loading branch information
ran-huang and DanielZhangQD authored Jun 23, 2020
1 parent 301d21d commit fbc92a8
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 13 deletions.
4 changes: 3 additions & 1 deletion en/TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@
- [Maintain a Kubernetes Node](maintain-a-kubernetes-node.md)
- [Collect TiDB Logs](collect-tidb-logs.md)
- [Enable Automatic Failover](use-auto-failover.md)
- [Recover the PD Cluster](pd-recover.md)
- [Destroy a TiDB Cluster](destroy-a-tidb-cluster.md)
+ Disaster Recovery
- [Recover PD Cluster](pd-recover.md)
- [Recover Deleted Cluster](recover-deleted-cluster.md)
- [Import Data](restore-data-using-tidb-lightning.md)
- [Troubleshoot](troubleshoot.md)
- [FAQs](faq.md)
Expand Down
33 changes: 33 additions & 0 deletions en/recover-deleted-cluster.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Recover the Deleted Cluster
summary: Learn how to recover a TiDB cluster that has been deleted mistakenly.
category: how-to
---

# Recover the Deleted Cluster

This document describes how to recover a TiDB cluster that has been deleted mistakenly.

## Recover the cluster managed by TidbCluster

TiDB Operator uses PV (Persistent Volume) and PVC (Persistent Volume Claim) to store persistent data. If you accidentally delete a cluster using `kubectl delete tc`, the PV/PVC objects and data are still retained to ensure data safety.

To recover the deleted cluster, use the `kubectl create` command to create a cluster that has the same name and configuration as the deleted one. In the new cluster, the retained PV/PVC and data are reused.

{{< copyable "shell-regular" >}}

```shell
kubectl -n ${namespace} create -f tidb-cluster.yaml
```

## Recover the cluster managed by Helm

TiDB Operator uses PV (Persistent Volume) and PVC (Persistent Volume Claim) to store persistent data. If you accidentally delete a cluster using `helm delete`, the PV/PVC objects and data are still retained to ensure data safety.

To recover the cluster at this time, use the `helm install` command to create a cluster that has the same name and configuration as the deleted one. In the new cluster, the retained PV/PVC and data are reused.

{{< copyable "shell-regular" >}}

```shell
helm install pingcap/tidb-cluster -n ${release_name} --namespace=${namespace} --version=${chart_version} -f values.yaml
```
12 changes: 0 additions & 12 deletions en/troubleshoot.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,6 @@ To use the diagnostic mode for troubleshooting:
After the Pod is rebuilt, it automatically returns to the normal mode.
## Recover the cluster after accidental deletion
TiDB Operator uses PV (Persistent Volume) and PVC (Persistent Volume Claim) to store persistent data. If you accidentally delete a cluster using `helm delete`, the PV/PVC objects and data are still retained to ensure data safety.
To restore the cluster at this time, use the `helm install` command to create a cluster with the same name. The retained PV/PVC and data are reused.
{{< copyable "shell-regular" >}}
```shell
helm install pingcap/tidb-cluster -n ${release_name} --namespace=${namespace} --version=${version} -f values.yaml
```
## Pod is not created normally
After creating a cluster using `helm install`, if the Pod is not created, you can diagnose it using the following commands:
Expand Down

0 comments on commit fbc92a8

Please sign in to comment.