Xtrabackup Backup Recovery mysql full backup (1)

Source: Internet
Author: User
Tags percona perl script

Xtrabackup Backup and recovery mysql full Backup (1) Xtrabackup is an open-source project of percona. It is used to implement the innodb Hot Backup function similar to the InnoDB official Hot Backup Tool and can quickly back up and restore mysql databases. Xtrabackup contains two tools: xtrabackup is a tool used to hot back up data in innodb and xtradb tables. It cannot back up tables of other engines or back up data table structures; innobackupex is a perl script that encapsulates xtrabackup and provides the ability to back up myisam tables. Install the rpm package. You can download the rpm package from the official website [root @ aeolus1 ~] # Rpm-ivh percona-xtrabackup-2.1.3-608.rhel5.x86_64.rpm warning: percona-xtrabackup-2.1.3-608.rhel5.x86_64.rpm: Header V4 DSA signature: NOKEY, key ID cd2efd2aPreparing... ######################################## ### [100%] 1: percona-xtrabackup ##################################### ###### [100%] After installation, the following two tools are available under/usr/bin: innobackupex and xtrabackup root @ aeolus1 bin] # ll inno *-rwxr-xr-x 1 root 110738 M Ay 23 Jun 1 root 12 Jun 9 innobackupex-1.5.1-> innobackupex [root @ aeolus1 bin] # ll * xtrabackup *-rwxr-xr-x 1 root 2894280 May 23 xtrabackup -rwxr-xr-x 1 root 4494952 May 23 xtrabackup_55-rwxr-xr-x 1 root 11633272 May 23 xtrabackup_56 through an instance, this section describes the complete backup and recovery process of xtrabackup and the issues that need attention. 1. Create a full backup Innobackupex -- user = root -- password = passwd/root/mysqlbackup/. In this way, a full backup is created, and the backup file is stored under the directory name with the timestamp, the following options are also available: defaults-file =/etc/my. the mysql configuration file used for cnf backup -- no-timestamp is not named after the timestamp directory name 2. After the backup is created, the data cannot be used for restoration. Some committed transactions may not be undone or the transactions in the logs need to be replayed. To ensure data consistency, we need to apply the logs to the backup files. Innobackupex -- apply-log/root/mysqlbackup/2013-06-14_16-20-56 backup data can be applied and restored 3 drop database mysql and then innobackupex -- user = root -- copy-back/root/mysqlbackup/ 2013-06-14_16-20-56 Recovery completed, change the permission of the data file and start the database chown-R mysql: mysql/usr/local/mysql/data. Note that in case of full recovery, the server 1 must be disabled, the server does not need to be shut down when it is partially restored. 2. The datadir directory must be empty. If a file exists, -- copy-back will not be copied. 3. After each operation is completed, check whether innobackupex: completed OK exists in the log! It indicates the completion of the action.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.