当前位置:网站首页>Restore backup data on GCS with br
Restore backup data on GCS with br
2022-07-07 04:02:00 【Tianxiang shop】
This article describes how to store in Google Cloud Storage (GCS) 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 new edition (v1.1 And above ) Of CustomResourceDefinition (CRD) Realization , The bottom layer uses BR For cluster 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 GCS after , If needed from GCS 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 GCS Specify the path on spec.gcs.bucket In the bucket spec.gcs.prefix The backup data under the folder is restored to namespace test2 Medium TiDB colony demo2.
The first 1 Step : Prepare to restore the environment
Use BR take GCS The backup data on is restored to TiDB front , You need to prepare to restore the environment , And have the relevant permissions of the database .
Download the file backup-rbac.yaml, And execute the following command in
test2This namespace Create the required for recovery RBAC Related resources :kubectl apply -f backup-rbac.yaml -n test2Grant remote storage access .
Reference resources GCS Account Authorization , Authorized access GCS Remote storage .
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=user=root --from-literal=password=<password> --namespace=test2
The first 2 Step : Restore the specified backup data to TiDB colony
establish restore custom resource (CR), Restore the specified backup data to TiDB colony :
kubectl apply -f restore.yamlrestore.yamlThe contents of the document are as follows :--- apiVersion: pingcap.com/v1alpha1 kind: Restore metadata: name: demo2-restore-gcs namespace: test2 spec: # backupType: full br: cluster: demo2 clusterNamespace: test2 # logLevel: info # statusAddr: ${status-addr} # concurrency: 4 # rateLimit: 0 # 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 gcs: projectId: ${project_id} secretName: gcs-secret bucket: ${bucket} prefix: ${prefix} # location: us-east1 # storageClass: STANDARD_IA # objectAcl: privateIn the configuration
restore.yamlWhen you file , Please refer to the following information :- About GCS Storage related configuration , Please refer to GCS 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
RestoreCR after , View the status of the recovery through the following command :kubectl get rt -n test2 -owide
边栏推荐
- 自适应非欧表征广告检索系统AMCAD
- Adaptive non European advertising retrieval system amcad
- Web service performance monitoring scheme
- Leetcode: interview question 17.24 Maximum cumulative sum of submatrix (to be studied)
- Optimization cases of complex factor calculation: deep imbalance, buying and selling pressure index, volatility calculation
- Allow public connections to local Ruby on Rails Development Server
- C task expansion method
- List interview common questions
- ERROR: Could not build wheels for pycocotools which use PEP 517 and cannot be installed directly
- Class constant pool and runtime constant pool
猜你喜欢

数据的存储

复杂因子计算优化案例:深度不平衡、买卖压力指标、波动率计算

Tflite model transformation and quantification

Kotlin Android 环境搭建

QT 打开文件 使用 QFileDialog 获取文件名称、内容等

Free PHP online decryption tool source code v1.2

leetcode:面试题 17.24. 子矩阵最大累加和(待研究)

Codeworks 5 questions per day (1700 average) - day 7

On file uploading of network security

机器学习笔记 - 使用机器学习进行鸟类物种分类
随机推荐
Vernacular high concurrency (2)
AVL树插入操作与验证操作的简单实现
Que savez - vous de la sérialisation et de l'anti - séquence?
golang 压缩和解压zip文件
QT 项目 表格新建列名称设置 需求练习(找数组消失的数字、最大值)
什么是 CGI,什么是 IIS,什么是VPS「建议收藏」
史上最全MongoDB之安全认证
What is the experience of maintaining Wanxing open source vector database
Some common software related
QT thread and other 01 concepts
【knife-4j 快速搭建swagger】
Tencent cloud native database tdsql-c was selected into the cloud native product catalog of the Academy of communications and communications
Construction of Hisilicon universal platform: color space conversion YUV2RGB
OSCP工具之一: dirsearch用法大全
Force buckle ----- path sum III
Adaptive non European advertising retrieval system amcad
On file uploading of network security
Operational amplifier application summary 1
Simple implementation of AVL tree insertion and verification operations
【安全攻防】序列化與反序列,你了解多少?