当前位置:网站首页>Introduction and use of dumping
Introduction and use of dumping
2022-06-13 06:50:00 【Lao Wang's notes】
Dumpling Architecture and features
- Support multiple data forms ,SQL/CSV
- Logical derivation
- Support table filtering , Data row filtering ;
- Support Amazon S3 Cloud disk
- in the light of TiDB To optimize : Support memory limitation , adjustment GC Time , Optimize export performance with hidden columns ;
Dumpling Applicable scenario
- The amount of exported data is small , A dozen G The best ;
- Need to export SQL perhaps CSV scene , Data migration can be performed in heterogeneous databases
- The export efficiency is not high , Because the number is from TiDB Node export , Data reading and conversion are required , Less efficient than physical export ;
Dumpling Not applicable to the scene
- You need to export directly SST(KEY-VALUE)
- Incremental backup : At present, only the full amount is supported , Incremental is not supported ;
- Scenarios with large amount of data
Deploy
- tiup install dumpling perhaps tidb-toolkit package
jurisdiction
- SELECT
- RELOAD
- LOCK TABLES
- REPLICATION CLIENT
Parameter Introduction
Dumpling export sql
dumpling -u user -P 4000 -h 127.0.0.1
--filetype csv Specify file type ,sql/csv
--threads 32 Concurrency number
-o /export/servers/TiDB/backup Storage directory
-r 200000 Export time , Maximum lines per file
-F 256MiB Maximum size of a single file ,KB,MiB,GiB;
--where "id < 10000" # All exported tables will be id Screening , Not suitable for the whole library ;
--filter "employees.*" # Export the specified library
--filter "*.order" # Export... Under all libraries order surface ;
Be careful
- Dummpling The system library will be automatically excluded during full database backup
Consistency assurance
Dumpling adopt --consistency <consistency level> Flag controls export data “ Consistency assurance ” The way
- flush: The backup will be performed before flush table with read lock, The whole cluster can read or write ;FTRL, Warm preparation
- snapshot: The default value is , You can specify the timestamp of the backup , All data to be backed up is the data version at this point in time ;
- lock: Only the backed up tables are locked
- none: Don't lock ; Data changes in real time
- auto: The default method will be selected according to the target database type ,tidb Can choose snapshot,mysql Will use flush
Dumpling Backup
dumpling]# dumpling -h XX.XX.XX.XX -P4000 -u root --password '' --filetype sql --threads 2 -o /export/servers/TiDB/backup/dumpling -r 10000
Release version: v5.0.1
Git commit hash: 4cb115746bb658b6d1a12c0e49932bfd3a08afac
Git branch: heads/refs/tags/v5.0.1
Build timestamp: 2021-04-23 06:01:59Z
Go version: go version go1.13 linux/amd64
[2022/02/11 18:08:54.706 +08:00] [INFO] [versions.go:55] ["Welcome to dumpling"] ["Release Version"=v5.0.1] ["Git Commit Hash"=4cb115746bb658b6d1a12c0e49932bfd3a08afac] ["Git Branch"=heads/refs/tags/v5.0.1] ["Build timestamp"="2021-04-23 06:01:59"] ["Go Version"="go version go1.13 linux/amd64"]
[2022/02/11 18:08:54.709 +08:00] [INFO] [config.go:599] ["detect server type"] [type=TiDB]
[2022/02/11 18:08:54.709 +08:00] [INFO] [config.go:618] ["detect server version"] [version=5.3.0]
[2022/02/11 18:08:54.720 +08:00] [INFO] [client.go:193] ["[pd] create pd client with endpoints"] [pd-address="[XX.XX.XX.XX:2379,XX.XX.XX.XX:2379,XX.XX.XX.XX:2379]"]
[2022/02/11 18:08:54.724 +08:00] [INFO] [base_client.go:296] ["[pd] update member urls"] [old-urls="[http://XX.XX.XX.XX:2379,http://XX.XX.XX.XX:2379,http://XX.XX.XX.XX:2379]"] [new-urls="[http://XX.XX.XX.XX:2379,http://XX.XX.XX.XX:2379,http://XX.XX.XX.XX:2379]"]
[2022/02/11 18:08:54.724 +08:00] [INFO] [base_client.go:308] ["[pd] switch leader"] [new-leader=http://XX.XX.XX.XX:2379] [old-leader=]
[2022/02/11 18:08:54.724 +08:00] [INFO] [base_client.go:112] ["[pd] init cluster id"] [cluster-id=7058541070281534107]
[2022/02/11 18:08:54.725 +08:00] [INFO] [dump.go:936] ["generate dumpling gc safePoint id"] [id=dumpling_1644574134725790545]
[2022/02/11 18:08:54.730 +08:00] [INFO] [dump.go:83] ["begin to run Dump"] [conf="{\"s3\":{\"endpoint\":\"\",\"region\":\"\",\"storage-class\":\"\",\"sse\":\"\",\"sse-kms-key-id\":\"\",\"acl\":\"\",\"access-key\":\"\",\"secret-access-key\":\"\",\"provider\":\"\",\"force-path-style\":true,\"use-accelerate-endpoint\":false},\"gcs\":{\"endpoint\":\"\",\"storage-class\":\"\",\"predefined-acl\":\"\",\"credentials-file\":\"\"},\"AllowCleartextPasswords\":false,\"SortByPk\":true,\"NoViews\":true,\"NoHeader\":false,\"NoSchemas\":false,\"NoData\":false,\"CompleteInsert\":false,\"TransactionalConsistency\":true,\"EscapeBackslash\":true,\"DumpEmptyDatabase\":true,\"PosAfterConnect\":false,\"CompressType\":0,\"Host\":\"XX.XX.XX.XX\",\"Port\":4000,\"Threads\":2,\"User\":\"root\",\"Security\":{\"CAPath\":\"\",\"CertPath\":\"\",\"KeyPath\":\"\"},\"LogLevel\":\"info\",\"LogFile\":\"\",\"LogFormat\":\"text\",\"OutputDirPath\":\"/export/servers/TiDB/backup/dumpling\",\"StatusAddr\":\":8281\",\"Snapshot\":\"431115241965748232\",\"Consistency\":\"snapshot\",\"CsvNullValue\":\"\\\\N\",\"SQL\":\"\",\"CsvSeparator\":\",\",\"CsvDelimiter\":\"\\\"\",\"Databases\":[],\"Where\":\"\",\"FileType\":\"sql\",\"ServerInfo\":{\"ServerType\":3,\"ServerVersion\":\"5.3.0\"},\"Rows\":10000,\"ReadTimeout\":900000000000,\"TiDBMemQuotaQuery\":0,\"FileSize\":0,\"StatementSize\":1000000,\"SessionParams\":{\"tidb_snapshot\":\"431115241965748232\"},\"Tables\":null}"]
[2022/02/11 18:08:55.041 +08:00] [WARN] [writer.go:230] ["no data written in table chunk"] [database=tony] [table=hero] [chunkIdx=0]
[2022/02/11 18:08:55.198 +08:00] [WARN] [writer.go:230] ["no data written in table chunk"] [database=tony] [table=hero2] [chunkIdx=0]
[2022/02/11 18:08:55.586 +08:00] [INFO] [collector.go:212] ["backup Success summary: total backup ranges: 7, total success: 7, total failed: 0, total take(backup time): 823.020183ms, total take(real time): 823.083425ms, total size(MB): 5.18, avg speed(MB/s): 6.30, total rows: 262153"]
[2022/02/11 18:08:55.586 +08:00] [INFO] [main.go:81] ["dump data successfully, dumpling will exit now"]
Dumpling Backup file description
.
|-- metadata // Metadata file , Contains the backup time ,BINLOG POS,GTID etc.
|-- tony.hero.000000001.sql // Data files
|-- tony.hero2.000000001.sql
|-- tony.hero2-schema.sql // Create table statement
|-- tony.hero-schema.sql
`-- tony-schema-create.sql // Build library statement
Other backup methods
Back up the specified library :
dumpling -h XX.XX.XX.XX -P4000 -u root --password 'xxxxxx' --filetype sql -B tony --threads 2 -o /export/servers/TiDB/backup/dumpling -r 10000
Back up specific tables :
dumpling -h XX.XX.XX.XX -P4000 -u root --password 'xxxxxx' --filetype sql -T tony.hero2 --threads 2 -o /export/servers/TiDB/backup/dumpling -r 10000
Only the backup table name contains hero Of
dumpling -h XX.XX.XX.XX -P4000 -u root --password 'xxxxxx' --filetype sql -f "*.hero*" --threads 2 -o /export/servers/TiDB/backup/dumpling -r 10000
Filter some data rows
dumpling -h XX.XX.XX.XX -P4000 -u root --password 'xxxxxx' --filetype sql -f "*.hero*" --where "id < 10" --threads 2 -o /export/servers/TiDB/backup/dumpling -r 10000
边栏推荐
- 学习Mysql基础第一天
- JNI's bitmap grayscale image (rgba_8888 and rgb_565)
- What is the essence of social e-commerce disruption? How can businesses get more traffic?
- 景联文科技提供语音数据采集标注服务
- 【转】FPGA面试题
- Jinglianwen Technology: current situation and solutions of data acquisition and labeling industry
- Ijkplayer code walkthrough player network video data reading process details
- Detailed explanation of scrcpy client code walk through H264 raw stream decoding process
- 想进行快速钢网设计,还能保证钢网质量? 来看这里
- Fe of mL: introduction to vintage curve /vintage analysis, calculation logic and detailed introduction to case application
猜你喜欢
15、 IO stream (I)
Jinglianwen Technology: current situation and solutions of data acquisition and labeling industry
智能文娱稳步发展,景联文科技提供数据采集标注服务
MongoDB系列之SQL和NoSQL的区别
[SketchUp 2021] sketch master's image output and rendering style description [edge setting, plane setting, background setting, watermark setting, modeling setting, sky background creating sky, creatin
Recently, the popular social e-commerce marketing model, blind box e-commerce, how beautiful every second is accurately drained
MySQL系列之分库分表学习笔记
Construction and verification of Alibaba cloud server webrtc system
What is the essence of social e-commerce disruption? How can businesses get more traffic?
How to seize the bonus of social e-commerce through brand play to achieve growth and profit?
随机推荐
How to quickly support the team leader to attract new fission users in the business marketing mode of group rebate?
MongoDB系列之SQL和NoSQL的区别
Jinglianwen technology provides a one-stop smart home data acquisition and labeling solution
Intelligent entertainment has developed steadily, and jinglianwen technology provides data collection and labeling services
15、 IO stream (I)
Differences between SQL and NoSQL of mongodb series
[kernel] two methods of driver compilation: compiling into modules and compiling into the kernel (using miscellaneous device driver templates)
Cocos creator obtains user authorization interface and encapsulates createuserinfobutton
Command line for database
Upper computer development (code debugging of firmware download software)
十五、IO流(一)
Introduction to applet layout
时间格式化工具----moment.js(网页时间实时展示)
Session and browser
YOLOv5解析 | 参数与性能指标
The new business outlet of beautiful Tiantian second mode will be popular in the Internet e-commerce market
Jfinal uses freemaker to output map.
Periodontitis investigation (ongoing)
Kotlin collaboration - flow+room database
Network planning common interview knowledge (I)