Xtrabackup is an open-source project of percona. It supports hot backup of innodb, XtraDB, and MyISAM (locks the table)
The MyISAM storage engine locks tables and is also very depressing because Innodb and MyISAM storage engines are used online, which is a headache !!
Xtrabackup is a tool used to back up InnoDB data. It supports online Hot Backup (data read/write is not affected during Backup) and is a good alternative to InnoDB Hotbackup.
Percona?
MySqL derivative edition Percona Server
Percona has improved the MySQL database server and significantly improved its functions and performance compared with MySQL. This version improves the performance of InnoDB under high loads and provides DBA with some useful performance diagnostic tools. In addition, more parameters and commands are available to control server behavior.
Percona Server only contains the MySQL Server version, and does not provide corresponding improvements to MySQL Connector and GUI tools.
Percona Server uses google-mysql-tools, Proven Scaling, and Open Query to transform MySQL.
Official site: http://www.percona.com/this site has detailed document introduction, but is E,
Recommended reading:
MySQL open-source backup tool Xtrabackup backup deployment
MySQL Xtrabackup backup and recovery
Use XtraBackup to implement MySQL master-slave replication and quick deployment [master-slave table lock-free]
Install and use Xtrabackup from Percona to back up MySQL
XtraBackup details: click here
XtraBackup: click here
Let's take a look at the use of Xtrbackup.
First, install the xtrbackup tool. The installation methods are described in detail on the official website using the yum and rpm packages. Here, yum is easy to install.
Yum source setting method:
Http://www.percona.com/doc/percona-xtrabackup/2.1/installation/yum_repo.html
Vim/etc/yum. repos. d/Percona. repo
Add the following content:
[Percona]
Name = CentOS $ releasever-Percona
Baseurl = http://repo.percona.com/centos/?releasever/ OS /?basearch/
Enabled = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-percona
Gpgcheck = 1 download key file to <span style = \ "\\\\" \\\\\\\ "font-family: Las LAS, \ "\"> yum install percona-xtrabackup-2.0.1-446.rhel6.x86_64-y
Of course, you can also download the source code package for compilation and installation.
: Http://www.percona.com/downloads/XtraBackup/XtraBackup-2.1.5/binary/Linux
This section describes how xtrbackup backs up and recovers MySqL databases.
Xtrabackup has two main tools: xtrabackup and innobackupex.
(1) xtrabackup can only back up InnoDB and XtraDB data tables, but cannot back up MyISAM data tables.
(2) innobackupex-1.5.1 encapsulates xtrabackup, which is a script encapsulation, so innodb and myisam can be backed up at the same time, but a read lock is needed when processing myisam
(3) Help: http://www.percona.com/docs/wiki/percona-xtrabackup:start
Use this tool as follows:
Make sure that the mysql configuration file my. cnf contains datadir =/data/mysql. The following is a description.
First, a full backup:
Innobackupex-1.5.1 -- defaults-file =/etc/my. cnf -- no-timestamp -- host = localhost -- port = 3306 -- user = root -- password = RedHat/data/bak_data/full_bak this directory contains the backup content, let's take a look at everything:
Database Master Profile: backup-my.cnf
Innodb Log File: ibdata1
All Database directories in the database: innobackup, mysql, performance_schema, phpmyadmin, test, and wordpress
The last is the binary log and log information backed up by innobackupex. The backup flags:
Xtrabackup_binary
Xtrabackup_binlog_info
Xtrabackup_checkpoints
Xtrabackup_logfile
The following describes how to use innobackupex Incremental Backup:
First Incremental Backup:
Innobackupex-1.5.1 -- defaults-file =/etc/my. cnf -- no-timestamp -- host = localhost -- port = 3306 -- user = root -- password = redhat -- incremental-basedir =/data/bak_data/full_bak/data/bak_data/one_backup
The second Incremental Backup:
Innobackupex-1.5.1 -- defaults-file =/etc/my. cnf -- no-timestamp -- host = localhost -- port = 3306 -- user = root -- password = redhat -- incremental-basedir =/data/bak_data/one_backup/data/bak_data/two_backup
The third Incremental Backup:
Innobackupex-1.5.1 -- defaults-file =/etc/my. cnf -- no-timestamp -- host = localhost -- port = 3306 -- user = root -- password = redhat -- incremental-basedir =/data/bak_data/two_backup/data/bak_data/three_backup
In the preceding example, each Incremental backup is a directory or a compressed package.
Compression backup method:
Innobackupex-1.5.1 -- defaults-file =/etc/my. cnf -- no-timestamp -- host = localhost -- port = 3306 -- user = root -- password = redhat -- stream = tar/data/bak_data/2>/data/back_data/2.log | gzip ->/data/bak_data/full_bak.tar.gz (no more than 10 tests are performed, only one backup-my.cnf file in the compressed package, very depressed !)
It's more stable to use ordinary ones!
To continue reading the highlights of this article, please refer to page 2nd: