Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction of xtrabackup and backup principle

2025-04-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Xtrabackup introduction

Xtrabackup is an open source software implemented by percona based on innodb's ibbackup (fee), which completely covers the functions of ibbackup and is completely free, which is the conscience of the industry.

Xtrabackup includes two tools:

Xtrabackup can only back up the tables of innodb and xtradb engines, but not other engines.

Innobackupex it encapsulates the perl script of xtrabackup and overrides the functionality of xtrabackup. It can back up not only the tables of the nnodb and xtradb engines, but also the tables of the myisam engine (a read lock is required when backing up the myisam table).

Xtrabackup can realize not only the full backup of the database, but also the incremental backup of the database.

two。 Backup recovery proc

2.1 full backup process:

1) innobackupex starts the xtrabackup_log monitoring thread to monitor the changes of redolog files in real time, copies the logs newly written to the transaction log during the new backup to innobackup_log, and starts the xtrabackup copy thread to start copying innodb files.

2) start copying innodb files.

3) after copying the innodb file, flush tables with read lock

4) copy non-innodb files, .frm, .MYD MYI and other types of files.

5) record the current binlog and position

6) unlock the table unlock tables

7) stop the xtrabackup_log thread

2.2 full recovery process:

1) play back the xtrabackup_log log of the complete file, redo the committed transaction, and rollback the uncommitted transaction.

2) copy the complete files to the data directory under mysql.

2.3 incremental backup process:

The incremental backup is based on the last full backup, copying the pages with changes in the innodb page (LSN is greater than the LSN number in xtraback_checkpoints). The first incremental backup is based on the full backup, and each backup since then is based on the last additional backup, resulting in a consistent backup. The process of adding equipment is similar to that of complete equipment, except that step 2:

1) innobackupex starts the xtrabackup_log monitoring thread to monitor the changes of redolog files in real time, copies the logs newly written to the transaction log during the new backup to innobackup_log, and starts the xtrabackup copy thread to start copying innodb files.

2) start copying the data page that has changed since the last innodb backup, that is, the LSN in the current LSN > xtrabackup_checkpoints. 3) after copying the innodb file, flush tables with read lock

4) copy non-innodb files, .frm, .MYD MYI and other types of files.

5) record the current binlog and position

6) unlock the table unlock tables

7) stop the xtrabackup_log thread

2.4 additional backup recovery process:

1) restore full readiness

2) resume backup and rollback uncommitted transactions

3) apply_log the backup files after the combination of full backup and additional backup

4) copy the backup file to the data directory of mysql.

3. Installation steps

The installation environment is centos6.5+mysql5.7

Shell > https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-2.4.1/binary/redhat/6/x86_64/percona-xtrabackup-24-2.4.1-1.el6.x86_64.rpm

Rpm-ivh percona-xtrabackup-24-2.4.1-1.el6.x86_64.rpm

Prompt during installation:

[root@mysql-master local] # rpm-ivhpercona-xtrabackup-24-2.4.1-1.el6.x86_64.rpm

Warning:percona-xtrabackup-24-2.4.1-1.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID cd2efd2a: NOKEY

Error: Failed dependencies:

Libev.so.4 () (64bit) is needed bypercona-xtrabackup-24-2.4.1-1.el6.x86_64

The reason is that you need to install the dependency package libev.so.4 first.

Shell > rpm-ivh libev-4.15-1.el6.rf.x86_64.rpm

3. Install again: rpm-ivh percona-xtrabackup-24-2.4.1-1.el6.x86_64.rpm prompts you to install successfully

Steps for innobackupex backup and recovery: innobackupex application case

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report