-
Notifications
You must be signed in to change notification settings - Fork 124
add dumpling-lightning-job (#2770) #2794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ti-chi-bot
merged 2 commits into
pingcap:release-1.3
from
ti-chi-bot:cherry-pick-2770-to-release-1.3
Jun 9, 2025
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,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} | ||
| ``` |
This file contains hidden or 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,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} | ||
| ``` |
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.