http://blog.csdn.net/dbanote/article/details/13295727
http://blog.csdn.net/yangzhawen/article/details/50457922
http://blog.csdn.net/yangzhawen/article/details/28864763
Xtrabackup is an open source software developed by Percona, which is an open source alternative to the InnoDB hot standby tool Ibbackup (paid commercial software). Xtrabackup consists of parts: Xtrabackup and Innobackupex, where xtrabackup tools are used to back up the InnoDB and XTRADB engine tables While the Innobackupex tool is used to back up the tables of the MyISAM and InnoDB engines, this article describes how to do full and incremental backups with the Innobackupex tool.
Official website:http://www.percona.com/docs/wiki/percona-xtrabackup:start
Installation
Disclaimer: The following operations are best performed with MySQL users.
First, download the source tar package via wget:
- wget http://www.percona.com/redir/downloads/XtraBackup/LATEST/source/percona-xtrabackup-2.1.5.tar.gz
To install a dependency package:
- Yum install cmake gcc gcc-c++ libaio libaio-devel automake autoconf BZR bison libtool ncurses-devel zlib-devel
Unzip tar:
- TAR-ZXVF percona-xtrabackup-2.1.5.tar.gz
- CD percona-xtrabackup-2.1.5
The utils/build.sh script will automatically extract and compile the appropriate MySQL source package according to the specified engine version, which is the simplest way to install it. When you execute the script without any parameters at the command line, the following prompt appears:
- [Email protected] ~/software/percona-xtrabackup-2.1.5]$./utils/build.sh
- Build an xtrabackup binary against the specified InnoDB flavor.
- Usage:build.sh CODEBASE
- Where CODEBASE can be one of the following values or aliases:
- innodb51 | Plugin build against InnoDB plugin in MySQL 5.1
- innodb55 | 5.5 Build against InnoDB in MySQL 5.5
- innodb56 | 5.6,XTRADB56, build against InnoDB in MySQL 5.6
- | mariadb100
- xtradb51 | XTRADB,MARIADB51 build against Percona Server with XTRADB 5.1
- | Mariadb52,mariadb53
- xtradb55 | Galera55,mariadb55 build against Percona Server with XtraDB 5.5
Depending on the prompts above and the storage engine and version you are using, select the appropriate parameters. Because I am using MySQL 5.6, the following statement is installed:
- ./utils/build.sh innodb56
After the execution of the above statement succeeds, the installation is complete. Finally, copy the generated binaries to a custom directory (in this case,/home/mysql/admin/bin/percona-xtrabackup-2.1.5) and place the directory in the environment variable path.
- CP./innobackupex/home/mysql/admin/bin/percona-xtrabackup-2.1.5
- CP./src/xtrabackup_56./src/xbstream/home/mysql/admin/bin/percona-xtrabackup-2.1.5
- Here I'm putting him direct CP into the/usr/bin directory
My MySQL version here is 5.6.23.
The Xtrabackup version I'm using here is 2.1.9.
Problems encountered during the installation
1:./utils/build.sh:line 173:patch:command not found
The workaround is: yum-y Install patch
And then execute it again.
./utils/build.sh innodb56
Here we create a normal user for hot standby
User-owned permissions are
SELECT, RELOAD, SHOW DATABASES, LOCK TABLES
Permissions List
1.Select Read
2.SHOW DATABASES allows access to the full list of databases
4. Lock TABLES allows locking of the table
5.RELOAD Allow server cache loading and flushing
The installation method of the hot standby percona-xtrabackup and Innobackupex of MySQL