MySQL backup and recovery-Use of percona-xtrabackup Software

Source: Internet
Author: User
Tags mysql backup percona server

Why percona-xtrabackup

We have discussed MySQL Cold Standby, Hot Standby, mysqldump, and hot copy to ensure data consistency. Because mysql cold backup, mysqldump, and mysql hot copy cannot achieve Incremental backup, Incremental backup is used in a large number of actual environments, and percona-xtrabackup is generated for Incremental backup, therefore, we need to use percona-xtrabackup.

MySQL backup and recovery-use cold backup in the real environment

Cold backup for MySQL backup and recovery

Hot Backup for MySQL backup and recovery

MySQL backup and recovery mysqldump

Hot copy of MySQL backup and recovery

MySQL backup and recovery to ensure data consistency

This article explains the use of percona-xtrabackup software, and the next article explains how percona-xtrabackup achieves Incremental backup and recovery.

 

What is percona-xtrabackup?

Percona XtraBackupIs an open-source hot backup utilityMySQL-Based servers that doesn't lock your database during the backup.

 

It can back up data from InnoDB, XtraDB, and MyISAM tablesonMySQL5.1 [1], 5.5 and5.6 servers, as wellPercona ServerWith XtraDB. For a high-level overview of features of its advanced features, including a featurecomparison, please see AboutPercona Xtrabackup.

 

Whether it is a 24x7 highly loaded server or alow-transaction-volume environment,Percona XtraBackupIsdesigned to make backups a seamless procedure without disrupting theperformance of the server in a production environment. inclucial support contracts areavailable.

 

Percona XtraBackupIs a combination of the xtrabackupCProgram, and the innobackupexPerlScript. The xtrabackupprogramcopies and manipulates InnoDB and XtraDB datafiles, andPerlScript enables enhanced functionality, such as interacting with a runningMySQLServer and backing up MyISAM tables.

 

3. Obtain software and documents

 

Software acquisition

Http://www.percona.com/software/percona-xtrabackup/downloads

Http://download.csdn.net/detail/wentasy/6638171

 

Document Retrieval

Http://www.percona.com/doc/percona-xtrabackup/2.1/

Http://download.csdn.net/detail/wentasy/6638029

 

4. software usage

 

Note: The percona-xtrabackup version used in this article is 2.0.2, the operating system version is RHEL 6.1 Server, and the MySQL version is 5.1.

 

Step 1: Prepare and copy the file

[root@larrywen ule-mysql]# ll percona-xtrabackup-2.0.2-461.rhel6.x86_64.rpm -rwxr-xr-x. 1 root root 3786628 Sep 10 13:45 percona-xtrabackup-2.0.2-461.rhel6.x86_64.rpm[root@larrywen ule-mysql]# scp percona-xtrabackup-2.0.2-461.rhel6.x86_64.rpm 192.168.1.11:/opt

 

Step 2: The software depends on the MySQL client, so use yum for installation. Note that only the MySQL client is installed here, which is not in conflict with the MySQL client installed using the source code.

[root@serv01 opt]# yum install percona-xtrabackup-2.0.2-461.rhel6.x86_64.rpm -yInstalled:  percona-xtrabackup.x86_64 0:2.0.2-461.rhel6                                                                                         Dependency Installed:  mysql.x86_64 0:5.1.52-1.el6_0.1

 

Step 3: Initialize the backup

[root@serv01 databackup]# innobackupex --user=root --password=123456 /databackup/InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oyand Percona Inc 2009-2012.  All Rights Reserved.……innobackupex: Backup created in directory '/databackup/2013-09-10_21-49-44'innobackupex: MySQL binlog position: filename 'mysql-bin.000001', position 7312130910 21:50:03  innobackupex: completed OK!

 

Step 4: This backup file cannot be used. We need to perform a unified check.

[Root @ serv01 databackup] # lltotal 4drwxr-xr-x. 9 root 4096 Sep 10 2013-09-10_21-49-44 # perform a unified check [root @ serv01 databackup] # innobackupex -- apply-log/databackup/2013-09-10_21-49-44/InnoDB Backup Utility v1.5.1-xtrabackup; copyright 2003,200 9 Innobase Oyand Percona Inc 2009-2012. all Rights Reserved. ...... Xtrabackup: starting shutdown with innodb_fast_shutdown = 1130910 21:51:52 InnoDB: Starting shutdown... 130910 21:51:56 InnoDB: Shutdown completed; log sequence number 2098188130910 21:51:56 innobackupex: completed OK!

 

Step 5: Simulate data loss

[root@serv01 databackup]# rm -rf /usr/local/mysql/data/*[root@serv01 databackup]# ll /usr/local/mysql/data/total 0

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • Next Page

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.