In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article is to share with you about the usefulness of mydumper. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Mydumper main features: is a high-performance multi-threaded backup and recovery tool for MySQL, developers are mainly from MySQL,Facebook,SkySQL.
Properties:
1: written in lightweight C language
2: execution speed is 10 times faster than that of mysqldump
3: consistent snapshots of transactional and non-transactional tables (for version 0.2.2 and above)
4: fast file compression
5: support exporting binlog
6: multithreaded recovery (for version 0.2.1 or above)
7: scheduled snapshots and continuous binary logs in the way daemons work (for version 0.5.0 and above)
8: open source GNU GPLv3
Installation address and installation method:
Yum install glib2-devel mysql-devel zlib-devel pcre-devel zlib gcc-c++ gcc cmake-y
Wget https://launchpadlibrarian.net/225370879/mydumper-0.9.1.tar.gz
Tar xf mydumper-0.9.1.tar.gz
Cd mydumper-0.9.1/
Cmake.
Make & & make install
The following is the size of the compressed backup for percona-xtrabackup and mydumper:
[root@test-5-69 bak] # du-sh *
3.3G 2017-02-09 04-00-02
3.3G 2017-02-100 04-00-02
3.3G 2017-02-11 04-00-02
3.3G 2017-02-1211 04-00-02
3.3G 2017-02-130004-02
3.3G 2017-02-14 04-00-02
3.3G 2017-02-150004-02
852M all_20170215
Advantages to use in the test library:
Mydumper exports are in the form of one file per table, which is very effective for development and test misoperation recovery. While percona-xtrabackup is for the whole library, recovery is also for the whole library. It is tedious to recover the misoperation of a single table.
Storage format after mydumper backup:
[root@test-5-69 all_20170215] # ls
Jxcommoninfo.orderinfo-schema.sql.gz jxorder.ord_OrderCount.sql.gz metadata
Jxcommoninfo.orderinfo.sql.gz jxorder.ord_OrderExchangeCodeDetail-schema.sql.gz mysql.columns_priv-schema.sql.gz
Jxcommoninfo-schema-create.sql.gz jxorder.ord_OrderExchangeCodeDetail.sql.gz mysql.db-schema.sql.gz
Jxorder.checksums-schema.sql.gz jxorder.ord_OrderExt-schema.sql.gz mysql.db.sql.gz
Jxorder.dsns-schema.sql.gz jxorder.ord_OrderExt.sql.gz mysql.event-schema.sql.gz
Jxorder.dsns.sql.gz jxorder.ord_OrderMarkLog-schema.sql.gz mysql.func-schema.sql.gz
Jxorder.dz_packingMaterialsOrder-schema.sql.gz jxorder.ord_OrderMark-schema.sql.gz mysql.help_category-schema.sql.gz
[root@test-5-69 all_20170215] # mydumper-help
Application Options:
-B,-- the database that database needs to back up, one database with one command backup, or all databases, including mysql.
-T,-- tables that tables-list needs to back up, separated by commas.
-o,-- outputdir backup file directory
-s,-- statement-size generates the number of bytes of the insert statement. Default is 1000000. This parameter cannot be too small, otherwise it will be reported to Row bigger than statement_size for tools.t_serverinfo.
-r,-- rows attempts to split the table with row blocks, and this parameter turns off-- chunk-filesize
-F,-- the file size of the chunk-filesize line block partition table in MB
-c,-- compress compressed output file
-e,-- build-empty-files generates an empty file even if the table has no data
-x,-- regex regular expression matching, such as' db.table'
-I,-- ignore-engines ignored storage engine, separated by commas
-m,-- no-schemas does not export table structure
-d,-- no-data does not export table data
-G,-- triggers export trigger
-E,-- events export event
-R,-- routines export stored procedure
-k,-- no-locks does not perform shared read lock warning: this will result in inconsistent backups
The less-locking is reduced to the smallest lock on the innodb table.
-l,-- long-query-guard sets a long query time. Default is 60 seconds. If the query time exceeds this time, an error will be reported: There are queries in PROCESSLIST running longer than 60s, aborting dump.
-K,-- kill-long-queries kill drops the query that has been executed for a long time. Backup error: Lock wait timeout exceeded; try restarting transaction
-D,-- daemon enables daemon mode
-I,-- snapshot-interval dump snapshot interval. Default is 60s, which needs to be in daemon mode.
-L,-- logfile uses log files, default standard output to the terminal
-- Timestamp backup is allowed during tz-utc backup, which will cause problems with backup and restore in different time zones. It is turned off by default. Parameter:-- skip-tz-utc to disable.
-- skip-tz-utc
-- use-savepoints uses SavePoint to record the lock information of metadata, which requires SUPER permission
-- success-on-1146 Not increment error count and Warning instead of Critical in case of table doesn't exist
-- lock-all-tables locks all tables instead of FLUSH TABLE WITH READ LOCK
-U-- updated-since Use Update_time to dump only tables updated in the last U days
-- trx-consistency-only Transactional consistency only
-h,-- host The host to connect to
-u,-- user Username with privileges to run the dump
-p,-- password User password
-P,-- port TCP/IP port to connect to
-S,-- socket UNIX domain socket file to use for connection
-t,-- the number of threads performed by threads backups. Default is 4 threads.
-C,-- compress-protocol uses a compression protocol on mysql connections
-V-- version Show the program version and exit
-v,-- verbose more output, 0 = silent, 1 = errors, 2 = warnings, 3 = info, default 2
[root@test-5-69 all_20170215] # myloader-help
Application Options:
-d,-- the directory where the directory backup files are located
-Q,-- queries-per-transaction the number of query per transaction. Default is 1000.
-o,-- overwrite-tables delete the table first if it exists. Use this parameter to back up the table structure when you need to back up, otherwise the table will not be found by restore
-B,-- database specifies the database to be restored
-s,-- source-db restored database
-e,-- enable-binlog enables binary logging to recover data
-h,-- host The host to connect to
-u,-- user Username with privileges to run the dump
-p,-- password User password
-P,-- port TCP/IP port to connect to
-S,-- socket UNIX domain socket file to use for connection
-t,-- number of threads used by threads. Default is 4.
-C,-- Compression protocol is used on compress-protocol connections
-V-- version Show the program version and exit
-v,-- verbose more output, 0 = silent, 1 = errors, 2 = warnings, 3 = info, default 2
#! / bin/sh
. / etc/profile
DIR='/my/bak/'
DATE= `date +% Y% m% dice% Hmuri% M`
/ usr/local/bin/mydumper-c-o $DIR$DATE
Find $DIR-mindepth 1-maxdepth 1-type d-mtime + 3-exec rm-rf {}\
Thank you for reading! This is the end of this article on "what's the use of mydumper?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.