xtrabackup全备方案,备份恢复全过程记录(一)

2014-11-24 10:33:10 · 作者: · 浏览: 2
xtrabackup全备方案,备份恢复全过程记录
[ html]
mysql> use inno
Database changed
mysql> insert into mm select 1;
Query OK, 1 row affected (0.01 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> insert into mm select 2;
Query OK, 1 row affected (0.00 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> insert into mm select 3;
Query OK, 1 row affected (0.00 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> select * from mm;
+------+
| a |
+------+
| 1 |
| 2 |
| 3 |
+------+
3 rows in set (0.00 sec)
mysql> show create table mm;
+-------+-------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------+
| mm | CREATE TABLE `mm` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+-------+-------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> exit
mysql> use inno
Database changed
mysql> create table t(a int)
-> ;
Query OK, 0 rows affected (0.06 sec)
mysql> show create table t;
+-------+------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+-------+------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
mysql> insert into t select 1;
Query OK, 1 row affected (0.00 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> insert into t select 2;
Query OK, 1 row affected (0.01 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> insert into t select 3;
Query OK, 1 row affected (0.00 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> select * from t;
+------+
| a |
+------+
| 1 |
| 2 |
| 3 |
+------+
3 rows in set (0.00 sec)
mysql>
以上是准备环境,以下开始进行测试;
[html]
全备:
[root@Slave02 back_up]# xtrabackup_55 --defaults-file=/etc/my.cnf --backup --target-dir=/data/back_up/
xtrabackup_55 version 1.6.2 for MySQL server 5.5.10 Linux (i686) (revision id: undefined)
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /usr/local/mysql/data
xtrabackup: Target instance is assumed as followings.
xtrabackup: innodb_data_home_dir = ./
xtrabackup: innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 2
xtrabackup: innodb_log_file_size = 5242880
130327 14:11:12 InnoDB: Using Linux native AIO
130327 14:11:12 InnoDB: Warning: allocated tablespace 2, old maximum was 0
>> log scanned up to (893330211)
[01] Copying ./ibdata1
to /data/back_up//ibdata1
>> log scanned up to (893330211)
>> log scanned up to (893330211)
[01] ...done
[01] Copying ./inno/mm.ibd
to /data/back_up//inno/mm