Detailed description of innobackupex Backup Recovery and innobackupex Backup Recovery
I don't want to talk about anything that is useless. Let's look at the actual operation ..
Let's just say, innobackupex reads locks for non-innodb tables during the backup process, and adds a lock to the innodb table. I don't know what it is called, in short, the table structure cannot be changed. I'm dull and don't know what the lock is. The following is a detailed diagram of the backup process.
Environment: 10.186.20.45: 3309
Test. t
Insert into t select 8;
Basic Backup 1;
Step 1:
Time (depending on the backup execution time) innobackupex-user = root-password = redhat-socket =/tmp/mysql3309.sock-defaults-file =/usr/local/mysql3309/my. cnf-database = test/data/backup/back3309/base-no-timestamp
Step 2;
Create Table t1 and insert data
Create table t1 (id int );
Insert into t1 select 1;
T syntax to use near "at line 1
Mysql> select * from t;
+ -- +
| Id |
+ -- +
| 8 |
+ -- +
1 row in set (0.00 sec)
Mysql> create table t1 (id int );
Query OK, 0 rows affected (0.03 sec)
Mysql>
Mysql> insert into t1 select 1;
Query OK, 1 row affected (0.01 sec)
Records: 1 Duplicates: 0 Warnings: 0
Mysql>
Mysql>
Mysql> show variables like 'autocommit ';
+ ----- + --- +
| Variable_name | Value |
+ ----- + --- +
| Autocommit | ON |
+ ----- + --- +
1 row in set (0.00 sec)
Mysql>
Step 3:
Create Incremental Backup
Innobackupex-user = root-password = redhat-socket =/tmp/mysql3309.sock-defaults-file =/usr/local/mysql3309/my. cnf-database = test-incremental/data/backup/back3309/incremental1/-incremental-basedir =/data/backup/back3309/base-no-timestamp-parallel = 2
[Root @ mysql45 base] # ll
Total 208924
-Rw-r-1 root 295 Aug 2 17:36 backup-my.cnf
-Rw-r -- 1 root 213909504 Aug 2 :36 ibdata1
Drwx -- 2 root 4096 Aug 2 :36 test
-Rw-r-1 root 20 Aug 2 17:36 xtrabackup_binlog_info
-Rw-r -- 1 root 95 Aug 2 17:36 xtrabackup_checkpoints
-Rw-r-1 root 706 Aug 2 :36 xtrabackup_info
-Rw-r -- 1 root 2560 Aug 2 17:36 xtrabackup_logfile
[Root @ mysql45 base] # pwd
/Data/backup/back3309/base
[Root @ mysql45 base] #
Step 4:
Data Recovery
Process: recover basic backup, apply Incremental backup, apply the merged backup, and roll back the unsubmitted data.
Recover basic backup: time innobackupex-apply-log-redo-only-use-memory = 400 M/data/backup/back3309/base
Incremental application backup: time innobackupex-apply-log-use-memory = 400 M/data/backup/back3309/base-incremental-dir =/data/backup/back3309/incremental1/
Apply the merged backup to roll back the uncommitted data: time innobackupex-apply-log-use-memory = 400 M/data/backup/back3309/base
[Root @ mysql45 test] # ll
Total 216
-Rw-r-1 root 8556 Aug 2 18:02 t1.frm
-Rw-r-1 root 98304 Aug 2 18:02 t1.ibd
-Rw-r -- 1 root 8556 Aug 2 18:02 t. frm
-Rw-r -- 1 root 98304 Aug 2 :36 t. ibd
[Root @ mysql45 test] #
Step 5:
Cp data to database data directory
[Root @ mysql45 base] # cp-r test/usr/local/mysql3309/data/
The file is changed and the recovery is complete.
This product is limited to images larger than 2 MB ??? Negative comment: why can I use my previous blog. Today's dog
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.