当前位置:网站首页>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
test2
This namespace Create the required for recovery RBAC Related resources :kubectl apply -f backup-rbac.yaml -n test2
Grant 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.tidb
TabularSELECT
andUPDATE
jurisdiction , Used for adjusting before and after recovery GC Time .establish
restore-demo2-tidb-secret
secret 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.yaml
restore.yaml
The 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: private
In the configuration
restore.yaml
When you file , Please refer to the following information :- About GCS Storage related configuration , Please refer to GCS Storage field introduction .
.spec.br
Some parameters in are optional , Such aslogLevel
、statusAddr
、concurrency
、rateLimit
、checksum
、timeAgo
、sendCredToTikv
. more.spec.br
Detailed 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_time
Parameters , Don't need to Restore CR Middle configurationspec.to
Field . - more
Restore
CR Detailed explanation of fields , Please refer to Restore CR Field is introduced .
Create good
Restore
CR after , View the status of the recovery through the following command :kubectl get rt -n test2 -owide
边栏推荐
- MySQL的存储引擎
- 二进制、八进制、十六进制
- 史上最全MongoDB之部署篇
- 再AD 的 界面顶部(菜单栏)创建常用的快捷图标
- GPT-3当一作自己研究自己,已投稿,在线蹲一个同行评议
- QT item table new column name setting requirement exercise (find the number and maximum value of the array disappear)
- [hcie TAC] question 3
- Tflite model transformation and quantification
- Introduction to opensea platform developed by NFT trading platform (I)
- Unity3D在一建筑GL材料可以改变颜色和显示样本
猜你喜欢
opencv第三方库
QT 使用QToolTip 鼠标放上去显示文字时会把按钮的图片也显示了、修改提示文字样式
Top 50 hit industry in the first half of 2022
Tflite model transformation and quantification
Implementation steps of docker deploying mysql8
力扣------路径总和 III
Kotlin Android environment construction
再AD 的 界面顶部(菜单栏)创建常用的快捷图标
Confirm the future development route! Digital economy, digital transformation, data This meeting is very important
Force buckle ----- path sum III
随机推荐
Kotlin Android 环境搭建
Machine learning notes - bird species classification using machine learning
GPT-3当一作自己研究自己,已投稿,在线蹲一个同行评议
[leetcode]Spiral Matrix II
Hisilicon 3559 universal platform construction: RTSP real-time playback support
Class constant pool and runtime constant pool
如何编写一个程序猿另一个面试官眼前一亮的简历[通俗易懂]
Optimization cases of complex factor calculation: deep imbalance, buying and selling pressure index, volatility calculation
使用 TiDB Lightning 恢复 GCS 上的备份数据
tflite模型转换和量化
Free PHP online decryption tool source code v1.2
一些常用软件相关
The most complete learning rate adjustment strategy in history LR_ scheduler
【安全攻防】序列化與反序列,你了解多少?
[security attack and Defense] how much do you know about serialization and deserialization?
Mysql-数据丢失,分析binlog日志文件
MySQL的索引
接口数据安全保证的10种方式
AVL树插入操作与验证操作的简单实现
ABAP 動態內錶分組循環