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

Principles of innobackupex backup and recovery

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

Share

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

Innobackupex

Full backup principle:

1. Execute checkpoint once to find the lsn of the last checkpoint

two。 Record all generated redo log from this lsn

3.cp innodb data

4.flush tables with read lock

5.cp non-innodb data (myisam data, .FYM, FIM, etc.)

6. Lock the binlog file and record the current binlog postion

7. Release all binlog locks, release unlock tables

The principle of incremental backup: some changes in step 3

3. Lsn of data pages, recording data pages with different lsn

Backup command:

Complete:

Innobackupex-user=$user-password=$pass-socket=$sock_path-no-timestamp-parallel=$num $DIR$basedir/basebk

Incremental backup:

Innobackupex-user=$user-password=$pass-socket=$sock_path-no-timestamp-parallel=$num-incremental-basedir=$dir_bak

-- incremental $dir_incre

Common parameters:

-- no-timestamp: use custom directories

-- parallel=$num: number of parallel threads

-- databases: specifies that the db list needs to be backed up, and can also be specified to a table

-- incremental-basedir: last backup directory

Innobackupex recovery principle: compare lsn in page head with lsn in redo log

If the redo lsn is larger than the lsn in the head of the page of the page, the page is restored

1. Only everything.

Innobackupex-apply-log / storage/group2/bak/basebk

two。 Incremental backup

Innobackupex-apply-log-redo-only / storage/group2/bak/basebk

Innobackupex-apply-log-incremental / storage/group2/bak/basebk-incremental-dir=/storage/group2/bak/incbk1

Common parameters:

-- apply-log: apply all redo log

-- redo-only: log of redo that only applies commit

-- incremental: complete during each recovery

Question 2: (confirm)

The-- redo-only parameter was used when the last incremental backup was applied, causing the mysql to fail to start

Error report: analysis of log loss or file corruption

Explanation: when mysql starts, it will check the data integrity of the mysql data page, and if you find a problem, you will try to

Recovery, and recovery is through the redolog, when the redolog can not be found, it will report an error and the page will be damaged.

Question 3: (confirmed)

Restore when there is an incremental backup, can you not use the-- redo-only parameter

No, it may cause some data loss.

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