当前位置:网站首页>Use br to recover backup data on azure blob storage
Use br to recover backup data on azure blob storage
2022-07-07 21:25:00 【Tianxiang shop】
This paper introduces how to combine Azure Blob Storage Upper SST Restore the backup data to Kubernetes In the environment TiDB colony .
The recovery method used in this article is based on TiDB Operator Of Custom Resource Definition (CRD) Realization , Bottom use BR Data recovery .BR Its full name is Backup & Restore, yes TiDB Command line tools for distributed backup and recovery , Used to deal with TiDB Cluster for data backup and recovery .
Use scenarios
When using BR take TiDB The cluster data is backed up to Azure Blob Storage after , If needed from Azure Blob Storage Will back up SST( Key value pair ) Restore files to TiDB colony , Please refer to this article to use BR Resume .
Be careful
- BR Only support TiDB v3.1 And above .
- BR The recovered data cannot be synchronized to the downstream , because BR Direct import SST file , At present, the downstream cluster has no way to obtain the upstream SST file .
This article assumes that it will be stored in Azure Blob Storage Specify the path on spec.azblob.container In the bucket spec.azblob.prefix The backup data under the folder is restored to namespace test2 Medium TiDB colony demo2. The following is the specific operation process .
The first 1 Step : Prepare to restore the environment
Use BR take Azure Blob Storage The backup data on is restored to TiDB front , Please follow these steps to prepare the recovery environment .
Download the file backup-rbac.yaml, And execute the following command in
test2This namespace Create what is needed for recovery RBAC Related resources :kubectl apply -f backup-rbac.yaml -n test2Grant remote storage access , There are two ways to grant permissions , Refer to the documentation Azure Account Authorization .
If you use it TiDB Version below v4.0.8, You also need to do the following . If you use it TiDB by v4.0.8 And above , Please skip this step .
Make sure you have the recovery database
mysql.tidbTabularSELECTandUPDATEjurisdiction , Used for adjusting before and after recovery GC Time .establish
restore-demo2-tidb-secretsecret For storing access TiDB Clustered root Account and key .kubectl create secret generic restore-demo2-tidb-secret --from-literal=password=${password} --namespace=test2
The first 2 Step : Restore the specified backup data to TiDB colony
According to the remote storage access authorization method selected in the previous step , You need to use the corresponding method below to restore the backup data to TiDB:
Method 1: If you authorize by accessing the key , You can create
RestoreCR Recover cluster data :kubectl apply -f resotre-azblob.yamlrestore-azblob.yamlThe contents of the document are as follows :--- apiVersion: pingcap.com/v1alpha1 kind: Restore metadata: name: demo2-restore-azblob namespace: test2 spec: br: cluster: demo2 clusterNamespace: test2 # logLevel: info # statusAddr: ${status_addr} # concurrency: 4 # rateLimit: 0 # timeAgo: ${time} # checksum: true # sendCredToTikv: true # # Only needed for TiDB Operator < v1.1.10 or TiDB < v4.0.8 # to: # host: ${tidb_host} # port: ${tidb_port} # user: ${tidb_user} # secretName: restore-demo2-tidb-secret azblob: secretName: azblob-secret container: my-container prefix: my-folderMethod 2: If it passes Azure AD Method of authorization , You can create
RestoreCR Recover cluster data :kubectl apply -f restore-azblob.yamlrestore-azblob.yamlThe contents of the document are as follows :--- apiVersion: pingcap.com/v1alpha1 kind: Restore metadata: name: demo2-restore-azblob namespace: test2 spec: serviceAccount: tidb-backup-manager br: cluster: demo2 sendCredToTikv: false clusterNamespace: test2 # logLevel: info # statusAddr: ${status_addr} # concurrency: 4 # rateLimit: 0 # timeAgo: ${time} # checksum: true # Only needed for TiDB Operator < v1.1.10 or TiDB < v4.0.8 to: host: ${tidb_host} port: ${tidb_port} user: ${tidb_user} secretName: restore-demo2-tidb-secret azblob: secretName: azblob-secret-ad container: my-container prefix: my-folder
In the configuration restore-azblob.yaml When you file , Please refer to the following information :
- About Azure Blob Storage Related configuration , Please refer to Azure Blob Storage Storage field introduction .
.spec.brSome parameters in are optional , Such aslogLevel、statusAddr、concurrency、rateLimit、checksum、timeAgo、sendCredToTikv. more.spec.brDetailed explanation of fields , Please refer to BR Field is introduced .- If you use it TiDB by v4.0.8 And above ,BR Will automatically adjust
tikv_gc_life_timeParameters , Don't need to Restore CR Middle configurationspec.toField . - more
RestoreCR Detailed explanation of fields , Please refer to Restore CR Field is introduced .
Create good Restore CR after , You can view the status of the recovery through the following command :
kubectl get rt -n test2 -o wide
边栏推荐
- openGl超级宝典学习笔记 (1)第一个三角形「建议收藏」
- Arlo's troubles
- easyui 日期控件清空值
- 数值法求解最优控制问题(〇)——定义
- The little money made by the program ape is a P!
- Small guide for rapid formation of manipulator (11): standard nomenclature of coordinate system
- 万字总结数据存储,三大知识点
- Numerical method for solving optimal control problem (0) -- Definition
- 使用高斯Redis实现二级索引
- 201215-03-19 - cocos2dx memory management - specific explanation "recommended collection"
猜你喜欢

95年专注安全这一件事 沃尔沃未来聚焦智能驾驶与电气化领域安全
![[C language] advanced pointer --- do you really understand pointer?](/img/ee/79c0646d4f1bfda9543345b9da0f25.png)
[C language] advanced pointer --- do you really understand pointer?

Cantata9.0 | new features

How does codesonar help UAVs find software defects?

使用高斯Redis实现二级索引
Klocwork code static analysis tool

An overview of the latest research progress of "efficient deep segmentation of labels" at Shanghai Jiaotong University, which comprehensively expounds the deep segmentation methods of unsupervised, ro

程序猿赚的那点钱算个P啊!

Codesonar Webinar
SQL注入报错注入函数图文详解
随机推荐
MySQL storage expression error
[function recursion] do you know all five classic examples of simple recursion?
Demon daddy B2 breaks through grammar and completes orthodox oral practice
开户必须往账户里面赚钱吗,资金安全吗?
The latest version of codesonar has improved functional security and supports Misra, c++ parsing and visualization
gridView自己定义做时间排版「建议收藏」
Virtual machine network configuration in VMWare
How can big state-owned banks break the anti fraud dilemma?
Hoj 2245 planktonic triangle cell (Mathematics)
Is it safe to open an account online now? I want to know where I can open an account in Nanning now?
H3C s7000/s7500e/10500 series post stack BFD detection configuration method
恶魔奶爸 B1 听力最后壁垒,一鼓作气突破
Insufficient permissions
Le capital - investissement est - il légal en Chine? C'est sûr?
easyui 日期控件清空值
C语言多角度帮助你深入理解指针(1. 字符指针2. 数组指针和 指针数组 、数组传参和指针传参3. 函数指针4. 函数指针数组5. 指向函数指针数组的指针6. 回调函数)
Klocwork code static analysis tool
Problems encountered in installing mysql8 for Ubuntu and the detailed installation process
Helix QAC 2020.2 new static test tool maximizes the coverage of standard compliance
Écrivez une liste de sauts