Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions en/TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,22 @@
- Amazon S3 Compatible Storage
- [Back Up Data Using BR](backup-to-aws-s3-using-br.md)
- [Restore Data Using BR](restore-from-aws-s3-using-br.md)
- [Back Up Data Using Dumpling](backup-to-s3.md)
- [Restore Data Using TiDB Lightning](restore-from-s3.md)
- [Back Up Data Using Dumpling](backup-to-s3-using-job.md)
- [Restore Data Using TiDB Lightning](restore-from-s3-using-job.md)
- [Back Up Data Using Dumpling (Deprecated)](backup-to-s3.md)
- [Restore Data Using TiDB Lightning (Deprecated)](restore-from-s3.md)
- Google Cloud Storage
- [Back Up Data Using BR](backup-to-gcs-using-br.md)
- [Restore Data Using BR](restore-from-gcs-using-br.md)
- [Back Up Data Using Dumpling](backup-to-gcs.md)
- [Restore Data Using TiDB Lightning](restore-from-gcs.md)
- [Back Up Data Using Dumpling](backup-to-gcs-using-job.md)
- [Restore Data Using TiDB Lightning](restore-from-gcs-using-job.md)
- [Back Up Data Using Dumpling (Deprecated)](backup-to-gcs.md)
- [Restore Data Using TiDB Lightning (Deprecated)](restore-from-gcs.md)
- Azure Blob Storage
- [Back Up Data Using BR](backup-to-azblob-using-br.md)
- [Restore Data Using BR](restore-from-azblob-using-br.md)
- [Back Up Data Using Dumpling](backup-to-blob-using-job.md)
- [Restore Data Using TiDB Lightning](restore-from-blob-using-job.md)
- Persistent Volumes
- [Back Up Data](backup-to-pv-using-br.md)
- [Restore Data](restore-from-pv-using-br.md)
Expand Down
115 changes: 115 additions & 0 deletions en/backup-to-blob-using-job.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
---
title: Back Up TiDB Data to Azure Blob Storage Using Dumpling
summary: Learn how to use Dumpling to back up TiDB cluster data to Azure Blob Storage.
---

# Back Up TiDB Data to Azure Blob Storage Using Dumpling

This document describes how to use [Dumpling](https://docs.pingcap.com/tidb/stable/dumpling-overview/) to back up data from a TiDB cluster deployed on Azure AKS to Azure Blob Storage. Dumpling is a data export tool that exports data from TiDB or MySQL in SQL or CSV format for full data backup or export.

## Prepare the Dumpling node pool

You can run Dumpling in an existing node pool or create a dedicated node pool. The following example shows how to create a new node pool. Replace the variables as needed:

- `${clusterName}`: AKS cluster name
- `${resourceGroup}`: Resource group name

```shell
az aks nodepool add --name dumpling \
--cluster-name ${clusterName} \
--resource-group ${resourceGroup} \
--zones 1 2 3 \
--node-count 1 \
--labels dedicated=dumpling
```

## Deploy the Dumpling job

This section describes how to configure, deploy, and monitor Dumpling jobs.

### Configure the Dumpling job

The following is a sample configuration for the Dumpling job. Replace the variables with your specific values as needed:

- `${name}`: Job name
- `${namespace}`: Kubernetes namespace
- `${version}`: Dumpling image version
- For Dumpling parameters, refer to the [Option list of Dumpling](https://docs.pingcap.com/tidb/stable/dumpling-overview/#option-list-of-dumpling).

```yaml
# dumpling_job.yaml
---
apiVersion: batch/v1
kind: Job
metadata:
name: ${name}
namespace: ${namespace}
labels:
app.kubernetes.io/component: dumpling
spec:
template:
spec:
nodeSelector:
dedicated: dumpling
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/component
operator: In
values:
- dumpling
topologyKey: kubernetes.io/hostname
containers:
- name: ${name}
image: pingcap/dumpling:${version}
command:
- /bin/sh
- -c
- |
/dumpling \
--host=basic-tidb \
--port=4000 \
--user=root \
--password='' \
--s3.region=us-west-2 \
--threads=16 \
--rows=20000 \
--filesize=256MiB \
--database=test \
--filetype=csv \
--output=azure://external/testfolder?account-name=${accountname}&account-key=${accountkey}
restartPolicy: Never
backoffLimit: 0
```

### Create the Dumpling job

Run the following commands to create the Dumpling job. Replace the variables with your specific values as needed:

```shell
export name=dumpling
export version=v8.5.1
export namespace=tidb-cluster
export accountname=<your-account-name>
export accountkey=<your-account-key>

envsubst < dumpling_job.yaml | kubectl apply -f -
```

### Check the Dumpling job status

Run the following command to check the Pod status of the Dumpling job. Replace the variables with your specific values as needed:

```shell
kubectl -n ${namespace} get pod ${name}
```

### View Dumpling job logs

Run the following command to view the logs of the Dumpling job. Replace the variables with your specific values as needed:

```shell
kubectl -n ${namespace} logs pod ${name}
```
123 changes: 123 additions & 0 deletions en/backup-to-gcs-using-job.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
---
title: Back Up TiDB Data to Google Cloud Storage (GCS) Using Dumpling
summary: Learn how to use Dumpling to back up TiDB cluster data to Google Cloud Storage (GCS).
---

# Back Up TiDB Data to Google Cloud Storage (GCS) Using Dumpling

This document describes how to use [Dumpling](https://docs.pingcap.com/tidb/stable/dumpling-overview/) to back up data from a TiDB cluster deployed on Google GKE to [Google Cloud Storage (GCS)](https://cloud.google.com/storage/docs). Dumpling is a data export tool that can export data from TiDB or MySQL in SQL or CSV format for full data backup or export.

## Prepare the Dumpling node pool

You can run Dumpling in an existing node pool or create a dedicated node pool. The following example shows how to create a new node pool. Replace the variables as needed:

- `${clusterName}`: GKE cluster name

```shell
gcloud container node-pools create dumpling \
--cluster ${clusterName} \
--machine-type n2-standard-4 \
--num-nodes=1 \
--node-labels=dedicated=dumpling
```

## Deploy the Dumpling job

### Create a credential ConfigMap

Save the `service account key` file downloaded from the Google Cloud Console as `google-credentials.json`, and then create a ConfigMap with the following command:

```shell
kubectl -n ${namespace} create configmap google-credentials --from-file=google-credentials.json
```

### Configure the Dumpling job

The following is a sample configuration file (`dumpling_job.yaml`) for the Dumpling job. Replace the variables as needed:

- `${name}`: job name
- `${namespace}`: Kubernetes namespace
- `${version}`: Dumpling image version
- For Dumpling parameters, refer to the [Option list of Dumpling](https://docs.pingcap.com/tidb/stable/dumpling-overview/#option-list-of-dumpling).

```yaml
# dumpling_job.yaml
---
apiVersion: batch/v1
kind: Job
metadata:
name: ${name}
namespace: ${namespace}
labels:
app.kubernetes.io/component: dumpling
spec:
template:
spec:
nodeSelector:
dedicated: dumpling
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/component
operator: In
values:
- dumpling
topologyKey: kubernetes.io/hostname
containers:
- name: ${name}
image: pingcap/dumpling:${version}
command:
- /bin/sh
- -c
- |
/dumpling \
--host=basic-tidb \
--port=4000 \
--user=root \
--password='' \
--threads=16 \
--rows=20000 \
--filesize=256MiB \
--database=test \
--filetype=csv \
--output=gcs://external/testfolder?credentials-file=/etc/config/google-credentials.json
volumeMounts:
- name: google-credentials
mountPath: /etc/config
volumes:
- name: google-credentials
configMap:
name: google-credentials
restartPolicy: Never
backoffLimit: 0
```

### Create the Dumpling job

Run the following commands to create the Dumpling job:

```shell
export name=dumpling
export version=v8.5.1
export namespace=tidb-cluster

envsubst < dumpling_job.yaml | kubectl apply -f -
```

### Check the Dumpling job status

Run the following command to check the Pod status of the Dumpling job:

```shell
kubectl -n ${namespace} get pod ${name}
```

### View Dumpling job logs

Run the following command to view the logs of the Dumpling job:

```shell
kubectl -n ${namespace} logs pod ${name}
```
14 changes: 12 additions & 2 deletions en/backup-to-gcs.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
---
<<<<<<< HEAD
title: Back up Data to GCS Using Dumpling
summary: Learn how to back up the TiDB cluster to GCS (Google Cloud Storage) using Dumpling.
=======
title: Back Up Data to GCS Using Dumpling (Helm)
summary: Learn how to use Helm to back up the TiDB cluster to GCS (Google Cloud Storage) using Dumpling.
aliases: ['/docs/tidb-in-kubernetes/dev/backup-to-gcs/']
>>>>>>> 3c9f232d (add dumpling-lightning-job (#2770))
---

# Back up Data to GCS Using Dumpling
# Back Up Data to GCS Using Dumpling (Helm)

> **Warning:**
>
> The Helm deployment method described in this document is deprecated. It is recommended to use the [Job method](backup-to-gcs-using-job.md) for backup operations.

This document describes how to back up the data of the TiDB cluster on Kubernetes to [Google Cloud Storage (GCS)](https://cloud.google.com/storage/docs/). "Backup" in this document refers to full backup (ad-hoc full backup and scheduled full backup).

The backup method described in this document is implemented using CustomResourceDefinition (CRD) in TiDB Operator v1.1 or later versions. [Dumpling](https://docs.pingcap.com/tidb/stable/export-or-backup-using-dumpling) is used to get the logic backup of the TiDB cluster, and then this backup data is sent to the remote GCS.
The backup method described in this document is implemented using CustomResourceDefinition (CRD) in TiDB Operator v1.1 or later versions. [Dumpling](https://docs.pingcap.com/tidb/stable/dumpling-overview/) is used to get the logic backup of the TiDB cluster, and then this backup data is sent to the remote GCS.

Dumpling is a data export tool that exports data stored in TiDB/MySQL as SQL or CSV files and can be used to make a logical full backup or export.

Expand Down
Loading
Loading