Xtrabackup backup principle, xtrabackup backup

Source: Internet
Author: User

Xtrabackup backup principle, xtrabackup backup
Percona XtraBackupWorking Principle

Percona XtraBackupIt is a crash recovery function based on InnoDB. CopyInnoDBData files, causing internal inconsistency; but then it crashes and recovers the files, making them consistent and available again.

This is becauseInnoDBMaintain a redo log, also known as a transaction log. This includes records of each change to InnoDB data. WhenInnoDBAt startup, it checks the data file and transaction log and performs two steps. It applies the committed transaction log entries to the data files and revokes any transaction that modifies the data but has not been committed.

Percona XtraBackupStart to work by recording the log serial number (LSN), and then copy the data file. This takes a short time to complete, so if the file is being changed, they reflect the status of the database at different time points. At the same time,Percona XtraBackupRun a background process, monitor the transaction log file, and copy the changes from it.Percona XtraBackupThis must be done continuously because transaction logs are written cyclically and can be reused after a period of time.Percona XtraBackupTransaction logging is required for each change since the data file is executed.

Percona XtraBackupBackup locks will be used as a lightweight alternative. This function is available inPercona Server5.6 + available.Percona XtraBackupUse this automatic copy of non-InnoDB data to avoid blocking modificationsInnoDBDML query of a table. When the server supports backup locks, xtrabackup will be copied firstInnoDBData, run and copyMyISAMTables and. frm files. Once the backup is completed, the file backup starts. It backs up. frm,. MRG,. MYD,. MYI,. TRG, flush tables with read locklock tables for backup. par

Note:

Lock onlyMyISAMAnd other non-InnoDB tables, only inPercona XtraBackupBack up all InnoDB/XtraDB data and logs.Percona XtraBackupBackup locks will be used as a lightweight alternative. This function is available inPercona Server5.6 + available.Percona XtraBackupUse this automatic copy of non-InnoDB data to avoid blocking modificationsInnoDBDML query of a table. FLUSH TABLES WITH READ LOCK

Xtrabackup then blocks all operations and may change the location or report of binary logs. Then, xtrabackup copies the REDO log file and obtains the binary log coordinates. After this is done, xtrabackup will unlock the binary log and table. Lock binlog for BACKUPExec_Master_Log_PosExec_Gtid_SetSHOW MASTER/SLAVE STATUS

Finally, the location of the binary log is printed to STDERR and xtrabackup, and 0 is returned if everything is normal.

Note that the xtrabackup of STDERR is not written in any file. You must redirect it to a file, for example ,. Xtrabackup OPTIONS2> backupout. log

It will also create the following files in the backup directory.

In the preparation phase,Percona XtraBackupUse the copied transaction log file to perform crash recovery on the copied data file. After this operation, the database can be restored and used.

Backed upMyISAMAndInnoDBThe tables will eventually be consistent, because after the preparation (recovery) process,InnoDBData will be rolled back to the point where the backup is completed before the meeting, instead of rolling back to the point. This time point matches the position taken, soMyISAMData and preparedInnoDBData is synchronized. FLUSH TABLES WITHREAD LOCK

In short, these tools allow you to perform streaming and Incremental backup operations by copying data files, copying log files, and applying logs to various combinations of data.

Our public account

Wuguiyunwei.com

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.