MySQL Study之--MySQL innodb引擎备份工具XtraBackup之三(数据库增量备份)
在MySQL中进行增量备份时,首先要进行一次全量备份,第一次增量备份是基于全备的,之后的增量备份是基于上一次的增量备份。
备份案例:
一、建立增量备份
1、构建测试环境:
[root@rh64 full]# service mysql start
Starting MySQL (Percona Server)[ OK ]
[root@rh64 full]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.25-73.1 Percona Server (GPL), Release 73.1, Revision 07b797f Copyright (c) 2009-2015 Percona LLC and/or its affiliates Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use prod;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select count(*) from t1;
+----------+
| count(*) |
+----------+
| 98304 |
+----------+
1 row in set (0.12 sec)
对数据库做一次全备:
【root@rh64 ~]# innobackupex --defaults-file=/etc/my.cnf --user=bakusr --password='oracle' --socket=/var/lib/mysql/mysql.sock /data/mysql/backup/full --no-timestamp
2、插入新的数据,做增量备份
mysql> insert into t1 select * from t1 order by 1 limit 10000;
Query OK, 10000 rows affected (0.46 sec)
Records: 10000 Duplicates: 0 Warnings: 0
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> select count(*) from t1;
+----------+
| count(*) |
+----------+
| 108304 |
+----------+
1 row in set (0.03 sec)
第一次增量备份:
[root@rh64 full]# innobackupex --defaults-file=/tmp/my.cnf --user=bakusr --password='oracle' --socket=/var/lib/mysql/mysql.sock --incremental-basedir=/data/mysql/backup/full --incremental /data/mysql/backup/inc_1 --no-timestamp --parallel=2
.....
151029 15:11:38 [01] Copying ./performance_schema/events_statements_summary_by_account_by_event_name.frm to /data/mysql/backup/inc_1/performance_schema/events_statements_summary_by_account_by_event_name.frm151029 15:11:38 [01] ...done151029 15:11:38 [01] Copying ./performance_schema/events_stages_history_long.frm to /data/mysql/backup/inc_1/performance_schema/events_stages_history_long.frm151029 15:11:38 [01] ...done151029 15:11:38 Finished backing up non-InnoDB tables and files151029 15:11:38 Executing LOCK BINLOG FOR BACKUP...151029 15:11:38 Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...xtrabackup: The latest check point (for incremental): '13869220'xtrabackup: Stopping log copying thread..151029 15:11:38 >> log scanned up to (13869220) ......151029 15:11:38 Executing UNLOCK BINLOG151029 15:11:38 Executing UNLOCK TABLES151029 15:11:38 All tables unlocked151029 15:11:38 Backup created in directory '/data/mysql/backup/inc_1'151029 15:11:38 [00] Writing backup-my.cnf151029 15:11:38 [00] ...done151029 15:11:38 [00] Writing xtrabackup_info151029 15:11:38 [00] ...donextrabackup: Transaction log of lsn (13869220) to (13869220) was copied.151029 15:11:38 completed OK!
查看全备的信息:
[root@rh64 full]# cat xtrabackup_checkpoints
backup_type = full-backuped
from_lsn = 0
to_lsn = 13254537
last_lsn = 13254537
compact = 0
recover_binlog_info = 0
[root@rh64 full]# cat xtrabackup_info
uuid = 14899a5d-7d3e-11e5-acbc-0800273dfa7f
name =
tool_name = innobackupex
tool_command = --defaults-file=/etc/my.cnf --user=bakusr --password=... --socket=/var/lib/mysql/mysql.sock /data/mysql/backup/full --no-timestamp
tool_version = 2.3.2
ibbackup_version = 2.3.2
server_version = 5.6.25-73.1
start_time = 2015-10-28 14:35:09
end_time = 2015-10-28 14:35:29
lock_time = 0
binlog_pos = (null)
innodb_from_lsn = 0
innodb_to_lsn = 13254537
partial = N
incremental = N
format = file
compact = N
compressed = N
encrypted = N
查看增量的备份信息:
[root@rh64 inc_1]# cat xtrabackup_checkpoints
backup_type = incremental
from_lsn = 13254537
to_lsn = 13869220
last_lsn = 13869220
compact = 0
recover_binlog_info = 0
[root@rh64 inc_1]# cat xtrabackup_info
uuid = 4c3a7567-7e0c-11e5-ba68-0800273dfa7f
name =
tool_name = innobackupex
tool_command = --defaults-file=/tmp/my.cnf --user=bakusr --password=... --socket=/var/lib/mysql/mysql.sock --incremental-basedir=/data/mysql/backup/full --incremental /data/mysql/backup/inc_1 --no-timestamp --parallel=2
tool_version = 2.3.2
ibbackup_version = 2.3.2
server_version = 5.6.25-73.1
start_time = 2015-10-29 15:11:19
end_time = 2015-10-29 15:11:38
lock_time = 0
binlog_pos = (null)
第二次增量备份:
mysql> insert into t1 select * from t1 order by 1 limit 10000;
Query OK, 10000 rows affected (0.43 sec)
Records: 10000 Duplicates: 0 Warnings: 0
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> select count(*) from t1;
+----------+
| count(*) |
+----------+
| 118304 |
+----------+
1 row in set (0.03 sec)
[root@rh64 full]# innobackupex --defaults-file=/tmp/my.cnf --user=bakusr --password='oracle' --socket=/var/lib/mysql/mysql.sock --incremental-basedir=/data/mysql/backup/inc_1 --incremental /data/mysql/backup/inc_2 --no-timestamp --parallel=2
151029 15:18:07 [01] Copying ./performance_schema/events_stages_history_long.frm to /data/mysql/backup/inc_2/performance_schema/events_stages_history_long.frm 151029 15:18:07 [01] ...done 151029 15:18:07 Finished backing up non-InnoDB tables and files 151029 15:18:07 Executing LOCK BINLOG FOR BACKUP... 151029 15:18:07 Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS... xtrabackup: The latest check point (for incremental): '14484422' xtrabackup: Stopping log copying thread. .151029 15:18:07 >> log scanned up to (14484422) ...... 151029 15:18:08 Executing UNLOCK BINLOG 151029 15:18:08 Executing UNLOCK TABLES 151029 15:18:08 All tables unlocked 151029 15:18:08 Backup created in directory '/data/mysql/backup/inc_2' 151029 15:18:08 [00] Writing backup-my.cnf 151029 15:18:08 [00] ...done 151029 15:18:08 [00] Writing xtrabackup_info 151029 15:18:08 [00] ...done xtrabackup: Transaction log of lsn (14484422) to (14484422) was copied. 151029 15:18:08 completed OK!
第二次增量备份信息:
[root@rh64 inc_2]# cat xtrabackup_checkpoints
backup_type = incremental
from_lsn = 13869220
to_lsn = 14484422
last_lsn = 14484422
compact = 0
recover_binlog_info = 0
[root@rh64 inc_2]# cat xtrabackup_info
uuid = 3456821a-7e0d-11e5-ba68-0800273dfa7f
name =
tool_name = innobackupex
tool_command = --defaults-file=/tmp/my.cnf --user=bakusr --password=... --socket=/var/lib/mysql/mysql.sock --incremental-basedir=/data/mysql/backup/inc_1 --incremental /data/mysql/backup/inc_2 --no-timestamp --parallel=2
tool_version = 2.3.2
ibbackup_version = 2.3.2
server_version = 5.6.25-73.1
start_time = 2015-10-29 15:17:48
end_time = 2015-10-29 15:18:08
lock_time = 0
binlog_pos = (null)
innodb_from_lsn = 13869220
innodb_to_lsn = 14484422
partial = N
incremental = Y
format = file
compact = N
compressed = N
encrypted = N
[root@rh64 inc_2]#
innodb_from_lsn = 13254537
innodb_to_lsn = 13869220
partial = N
incremental = Y
format = file
compact = N
compressed = N
encrypted = N
二、通过备份恢复数据
增量备份的恢复大体分为三个步骤:
1、恢复基础备份(全备)
2、恢复增量备份到基础备份(开始恢复的增量备份要添加--redo-only参数,到最后一次增量备份去掉--redo-only参数)
3、对整体基础备份进行恢复,回滚那些未提交的数据
1、测试环境
数据被误删除:
mysql> truncate table t1;
Query OK, 0 rows affected (0.60 sec)
mysql> select count(*) from t1;
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.00 sec)
2、数据恢复:
基础恢复prepare:
[root@rh64 inc_2]# innobackupex --apply-log --redo-only --use-memory=1g /data/mysql/backup/full
151029 15:27:00 innobackupex: Starting the apply-log operation IMPORTANT: Please check that the apply-log run completes successfully. At the end of a successful apply-log run innobackupex prints "completed OK!". innobackupex version 2.3.2 based on MySQL server 5.6.24 Linux (x86_64) (revision id: 306a2e0) xtrabackup: cd to /data/mysql/backup/full xtrabackup: This target seems to be not prepared yet. xtrabackup: xtrabackup_logfile detected: size=2097152, start_lsn=(13254537) xtrabackup: using the following InnoDB configuration for recovery: xtrabackup: innodb_data_home_dir = ./ xtrabackup: innodb_data_file_path = ibdata1:12M;ibdata2:10M:autoextend xtrabackup: innodb_log_group_home_dir = ./ xtrabackup: innodb_log_files_in_group = 1 xtrabackup: innodb_log_file_size = 2097152 xtrabackup: using the following InnoDB configuration for recovery: xtrabackup: innodb_data_home_dir = ./ xtrabackup: innodb_data_file_path = ibdata1:12M;ibdata2:10M:autoextend xtrabackup: innodb_log_group_home_dir = ./ xtrabackup: innodb_log_files_in_group = 1 xtrabackup: innodb_log_file_size = 2097152 xtrabackup: Starting InnoDB instance for recovery. xtrabackup: Using 1073741824 bytes for buffer pool (set by --use-memory parameter) InnoDB: Using atomics to ref count buffer pool pages InnoDB: The InnoDB memory heap is disabled InnoDB: Mutexes and rw_locks use GCC atomic builtins InnoDB: Memory barrier is not used InnoDB: Compressed tables use zlib 1.2.3 InnoDB: Using CPU crc32 instructions InnoDB: Initializing buffer pool, size = 1.0G InnoDB: Completed initialization of buffer pool InnoDB: Highest supported file format is Barracuda. InnoDB: The log sequence numbers 13254527 and 13254527 in ibdata files do not match the log sequence number 13254537 in the ib_logfiles! InnoDB: Database was not shutdown normally! InnoDB: Starting crash recovery. InnoDB: Reading tablespace information from the .ibd files... InnoDB: Restoring possible half-written data pages InnoDB: from the doublewrite buffer... InnoDB: 128 rollback segment(s) are active. InnoDB: Waiting for purge to start InnoDB: 5.6.24 started; log sequence number 13254537 xtrabackup: starting shutdown with innodb_fast_shutdown = 1 InnoDB: FTS optimize thread exiting. InnoDB: Starting shutdown... InnoDB: Shutdown completed; log sequence number 13254547 xtrabackup: using the following InnoDB configuration for recovery: xtrabackup: innodb_data_home_dir = ./ xtrabackup: innodb_data_file_path = ibdata1:12M;ibdata2:10M:autoextend xtrabackup: innodb_log_group_home_dir = ./ xtrabackup: innodb_log_files_in_group = 2 xtrabackup: innodb_log_file_size = 50331648 InnoDB: Using atomics to ref count buffer pool pages InnoDB: The InnoDB memory heap is disabled InnoDB: Mutexes and rw_locks use GCC atomic builtins InnoDB: Memory barrier is not used InnoDB: Compressed tables use zlib 1.2.3 InnoDB: Using CPU crc32 instructions InnoDB: Initializing buffer pool, size = 1.0G InnoDB: Completed initialization of buffer pool InnoDB: Setting log file ./ib_logfile101 size to 48 MB InnoDB: Setting log file ./ib_logfile1 size to 48 MB InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0 InnoDB: New log files created, LSN=13254547 InnoDB: Highest supported file format is Barracuda. InnoDB: 128 rollback segment(s) are active. InnoDB: Waiting for purge to start InnoDB: 5.6.24 started; log sequence number 13254668 xtrabackup: starting shutdown with innodb_fast_shutdown = 1 InnoDB: FTS optimize thread exiting. InnoDB: Starting shutdown... InnoDB: Shutdown completed; log sequence number 13254678 151029 15:27:07 completed OK!
将增量备份inc_1应用到基础备份full:(使用redo-only参数,只应用那些已经提交的事物,而不回滚那些未提交的事务)
[root@rh64 inc_2]# innobackupex --user='bakusr' --password='oracle' --apply-log --use-memory=1g /data/mysql/backup/full --redo-only --incremental-dir=/data/mysql/backup/inc_1
151029 15:37:54 [01] Copying ./performance_schema/events_statements_history_long.frm to /data/mysql/backup/full/2015-10-29_15-37-38/performance_schema/events_statements_history_long.frm 151029 15:37:54 [01] ...done 151029 15:37:54 [01] Copying ./performance_schema/events_statements_summary_by_account_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-37-38/performance_schema/events_statements_summary_by_account_by_event_name.frm 151029 15:37:54 [01] ...done 151029 15:37:54 [01] Copying ./performance_schema/events_stages_history_long.frm to /data/mysql/backup/full/2015-10-29_15-37-38/performance_schema/events_stages_history_long.frm 151029 15:37:54 [01] ...done 151029 15:37:55 Finished backing up non-InnoDB tables and files 151029 15:37:55 Executing LOCK BINLOG FOR BACKUP... 151029 15:37:55 Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS... xtrabackup: The latest check point (for incremental): '14489531' xtrabackup: Stopping log copying thread. .151029 15:37:55 >> log scanned up to (14489531) 151029 15:37:55 Executing UNLOCK BINLOG 151029 15:37:55 Executing UNLOCK TABLES 151029 15:37:55 All tables unlocked 151029 15:37:55 Backup created in directory '/data/mysql/backup/full/2015-10-29_15-37-38' 151029 15:37:55 [00] Writing backup-my.cnf 151029 15:37:55 [00] ...done 151029 15:37:55 [00] Writing xtrabackup_info 151029 15:37:55 [00] ...done xtrabackup: Transaction log of lsn (14489531) to (14489531) was copied. 151029 15:37:55 completed OK!
将增量备份inc_2应用到全备full(不使用redo-only,回滚那些未提交的事务):
[root@rh64 inc_2]# innobackupex --user='bakusr' --password='oracle' --apply-log --use-memory=1g /data/mysql/backup/full --incremental-dir=/data/mysql/backup/inc_2
51029 15:39:38 innobackupex: Starting the backup operation IMPORTANT: Please check that the backup run completes successfully. At the end of a successful backup run innobackupex prints "completed OK!". 151029 15:39:38 version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;mysql_socket=/var/lib/mysql/mysql.sock' as 'bakusr' (using password: YES). 151029 15:39:38 version_check Connected to MySQL server 151029 15:39:38 version_check Executing a version check against the server... 151029 15:39:38 version_check Done. 151029 15:39:38 Connecting to MySQL server host: localhost, user: bakusr, password: set, port: 0, socket: /var/lib/mysql/mysql.sock Using server version 5.6.25-73.1 innobackupex version 2.3.2 based on MySQL server 5.6.24 Linux (x86_64) (revision id: 306a2e0) xtrabackup: uses posix_fadvise(). xtrabackup: cd to /var/lib/mysql xtrabackup: open files limit requested 0, set to 1024 xtrabackup: using the following InnoDB configuration: xtrabackup: innodb_data_home_dir = ./ xtrabackup: innodb_data_file_path = ibdata1:12M;ibdata2:10M:autoextend xtrabackup: innodb_log_group_home_dir = ./ xtrabackup: innodb_log_files_in_group = 2 xtrabackup: innodb_log_file_size = 50331648 151029 15:39:38 >> log scanned up to (14489531) xtrabackup: Generating a list of tablespaces 151029 15:39:38 [01] Copying ./ibdata1 to /data/mysql/backup/full/2015-10-29_15-39-38/ibdata1 151029 15:39:39 >> log scanned up to (14489531) 151029 15:39:39 [01] ...done 151029 15:39:39 [01] Copying ./ibdata2 to /data/mysql/backup/full/2015-10-29_15-39-38/ibdata2 151029 15:39:39 [01] ...done 151029 15:39:40 [01] Copying ./prod/t2.ibd to /data/mysql/backup/full/2015-10-29_15-39-38/prod/t2.ibd 151029 15:39:40 [01] ...done 151029 15:39:40 >> log scanned up to (14489531) 151029 15:39:40 [01] Copying ./prod/t1.ibd to /data/mysql/backup/full/2015-10-29_15-39-38/prod/t1.ibd 151029 15:39:40 [01] ...done 151029 15:39:40 [01] Copying ./prod/t3.ibd to /data/mysql/backup/full/2015-10-29_15-39-38/prod/t3.ibd 151029 15:39:40 [01] ...done 151029 15:39:40 [01] Copying ./mysql/slave_worker_info.ibd to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/slave_worker_info.ibd 151029 15:39:40 [01] ...done 151029 15:39:40 [01] Copying ./mysql/slave_master_info.ibd to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/slave_master_info.ibd 151029 15:39:40 [01] ...done 151029 15:39:40 [01] Copying ./mysql/slave_relay_log_info.ibd to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/slave_relay_log_info.ibd 151029 15:39:40 [01] ...done 151029 15:39:40 [01] Copying ./mysql/innodb_index_stats.ibd to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/innodb_index_stats.ibd 151029 15:39:40 [01] ...done 151029 15:39:41 [01] Copying ./mysql/innodb_table_stats.ibd to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/innodb_table_stats.ibd 151029 15:39:41 [01] ...done 151029 15:39:41 >> log scanned up to (14489531) 151029 15:39:41 Starting to backup non-InnoDB tables and files 151029 15:39:41 [01] Copying ./prod/t1.frm to /data/mysql/backup/full/2015-10-29_15-39-38/prod/t1.frm 151029 15:39:41 [01] ...done 151029 15:39:41 [01] Copying ./prod/t2.frm to /data/mysql/backup/full/2015-10-29_15-39-38/prod/t2.frm 151029 15:39:41 [01] ...done 151029 15:39:41 [01] Copying ./prod/t3.frm to /data/mysql/backup/full/2015-10-29_15-39-38/prod/t3.frm 151029 15:39:41 [01] ...done 151029 15:39:42 [01] Copying ./prod/db.opt to /data/mysql/backup/full/2015-10-29_15-39-38/prod/db.opt 151029 15:39:42 [01] ...done 151029 15:39:42 [01] Copying ./test/db.opt to /data/mysql/backup/full/2015-10-29_15-39-38/test/db.opt 151029 15:39:42 [01] ...done 151029 15:39:42 [01] Copying ./mysql/time_zone_name.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_name.MYD 151029 15:39:42 [01] ...done 151029 15:39:42 [01] Copying ./mysql/help_topic.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_topic.frm 151029 15:39:42 [01] ...done 151029 15:39:42 >> log scanned up to (14489531) 151029 15:39:42 [01] Copying ./mysql/event.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/event.frm 151029 15:39:42 [01] ...done 151029 15:39:42 [01] Copying ./mysql/time_zone.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone.MYD 151029 15:39:42 [01] ...done 151029 15:39:42 [01] Copying ./mysql/slow_log.CSV to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/slow_log.CSV 151029 15:39:42 [01] ...done 151029 15:39:42 [01] Copying ./mysql/innodb_index_stats.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/innodb_index_stats.frm 151029 15:39:42 [01] ...done 151029 15:39:42 [01] Copying ./mysql/columns_priv.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/columns_priv.MYI 151029 15:39:42 [01] ...done 151029 15:39:42 [01] Copying ./mysql/plugin.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/plugin.MYI 151029 15:39:42 [01] ...done 151029 15:39:43 [01] Copying ./mysql/time_zone_leap_second.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_leap_second.frm 151029 15:39:43 [01] ...done 151029 15:39:43 [01] Copying ./mysql/time_zone_transition_type.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_transition_type.MYI 151029 15:39:43 [01] ...done 151029 15:39:43 [01] Copying ./mysql/proc.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/proc.frm 151029 15:39:43 >> log scanned up to (14489531) 151029 15:39:43 [01] ...done 151029 15:39:43 [01] Copying ./mysql/procs_priv.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/procs_priv.MYD 151029 15:39:43 [01] ...done 151029 15:39:43 [01] Copying ./mysql/proxies_priv.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/proxies_priv.MYI 151029 15:39:43 [01] ...done 151029 15:39:43 [01] Copying ./mysql/ndb_binlog_index.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/ndb_binlog_index.MYI 151029 15:39:43 [01] ...done 151029 15:39:43 [01] Copying ./mysql/servers.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/servers.MYI 151029 15:39:43 [01] ...done 151029 15:39:43 [01] Copying ./mysql/slow_log.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/slow_log.frm 151029 15:39:43 [01] ...done 151029 15:39:44 [01] Copying ./mysql/help_relation.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_relation.MYD 151029 15:39:44 [01] ...done 151029 15:39:44 [01] Copying ./mysql/user.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/user.frm 151029 15:39:44 [01] ...done 151029 15:39:44 [01] Copying ./mysql/plugin.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/plugin.frm 151029 15:39:44 [01] ...done 151029 15:39:44 >> log scanned up to (14489531) 151029 15:39:44 [01] Copying ./mysql/time_zone_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_name.frm 151029 15:39:44 [01] ...done 151029 15:39:44 [01] Copying ./mysql/user.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/user.MYI 151029 15:39:44 [01] ...done 151029 15:39:44 [01] Copying ./mysql/help_relation.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_relation.frm 151029 15:39:44 [01] ...done 151029 15:39:44 [01] Copying ./mysql/slow_log.CSM to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/slow_log.CSM 151029 15:39:44 [01] ...done 151029 15:39:44 [01] Copying ./mysql/time_zone_transition.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_transition.MYD 151029 15:39:44 [01] ...done 151029 15:39:44 [01] Copying ./mysql/help_category.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_category.MYI 151029 15:39:44 [01] ...done 151029 15:39:45 [01] Copying ./mysql/proc.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/proc.MYD 151029 15:39:45 [01] ...done 151029 15:39:45 [01] Copying ./mysql/db.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/db.MYD 151029 15:39:45 [01] ...done 151029 15:39:45 [01] Copying ./mysql/tables_priv.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/tables_priv.MYD 151029 15:39:45 [01] ...done 151029 15:39:45 >> log scanned up to (14489531) 151029 15:39:45 [01] Copying ./mysql/time_zone_leap_second.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_leap_second.MYI 151029 15:39:45 [01] ...done 151029 15:39:45 [01] Copying ./mysql/help_relation.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_relation.MYI 151029 15:39:46 [01] ...done 151029 15:39:46 [01] Copying ./mysql/ndb_binlog_index.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/ndb_binlog_index.MYD 151029 15:39:46 [01] ...done 151029 15:39:46 [01] Copying ./mysql/slave_worker_info.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/slave_worker_info.frm 151029 15:39:46 [01] ...done 151029 15:39:46 >> log scanned up to (14489531) 151029 15:39:46 [01] Copying ./mysql/time_zone.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone.frm 151029 15:39:46 [01] ...done 151029 15:39:46 [01] Copying ./mysql/slave_relay_log_info.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/slave_relay_log_info.frm 151029 15:39:46 [01] ...done 151029 15:39:46 [01] Copying ./mysql/columns_priv.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/columns_priv.MYD 151029 15:39:46 [01] ...done 151029 15:39:47 [01] Copying ./mysql/time_zone_transition_type.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_transition_type.MYD 151029 15:39:47 [01] ...done 151029 15:39:47 [01] Copying ./mysql/user.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/user.MYD 151029 15:39:47 [01] ...done 151029 15:39:47 [01] Copying ./mysql/tables_priv.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/tables_priv.frm 151029 15:39:47 [01] ...done 151029 15:39:47 >> log scanned up to (14489531) 151029 15:39:47 [01] Copying ./mysql/help_category.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_category.MYD 151029 15:39:47 [01] ...done 151029 15:39:47 [01] Copying ./mysql/help_keyword.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_keyword.MYD 151029 15:39:47 [01] ...done 151029 15:39:47 [01] Copying ./mysql/time_zone_transition.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_transition.frm 151029 15:39:47 [01] ...done 151029 15:39:47 [01] Copying ./mysql/servers.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/servers.frm 151029 15:39:47 [01] ...done 151029 15:39:47 [01] Copying ./mysql/general_log.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/general_log.frm 151029 15:39:47 [01] ...done 151029 15:39:48 [01] Copying ./mysql/help_keyword.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_keyword.frm 151029 15:39:48 [01] ...done 151029 15:39:48 [01] Copying ./mysql/time_zone_transition_type.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_transition_type.frm 151029 15:39:48 [01] ...done 151029 15:39:48 [01] Copying ./mysql/columns_priv.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/columns_priv.frm 151029 15:39:48 [01] ...done 151029 15:39:48 >> log scanned up to (14489531) 151029 15:39:48 [01] Copying ./mysql/proxies_priv.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/proxies_priv.frm 151029 15:39:48 [01] ...done 151029 15:39:48 [01] Copying ./mysql/help_keyword.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_keyword.MYI 151029 15:39:48 [01] ...done 151029 15:39:48 [01] Copying ./mysql/general_log.CSV to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/general_log.CSV 151029 15:39:48 [01] ...done 151029 15:39:48 [01] Copying ./mysql/event.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/event.MYD 151029 15:39:48 [01] ...done 151029 15:39:48 [01] Copying ./mysql/plugin.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/plugin.MYD 151029 15:39:48 [01] ...done 151029 15:39:48 [01] Copying ./mysql/proxies_priv.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/proxies_priv.MYD 151029 15:39:48 [01] ...done 151029 15:39:49 [01] Copying ./mysql/servers.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/servers.MYD 151029 15:39:49 [01] ...done 151029 15:39:49 [01] Copying ./mysql/event.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/event.MYI 151029 15:39:49 [01] ...done 151029 15:39:49 [01] Copying ./mysql/time_zone_transition.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_transition.MYI 151029 15:39:49 [01] ...done 151029 15:39:49 >> log scanned up to (14489531) 151029 15:39:49 [01] Copying ./mysql/tables_priv.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/tables_priv.MYI 151029 15:39:49 [01] ...done 151029 15:39:49 [01] Copying ./mysql/ndb_binlog_index.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/ndb_binlog_index.frm 151029 15:39:49 [01] ...done 151029 15:39:49 [01] Copying ./mysql/db.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/db.MYI 151029 15:39:49 [01] ...done 151029 15:39:49 [01] Copying ./mysql/time_zone_name.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_name.MYI 151029 15:39:49 [01] ...done 151029 15:39:49 [01] Copying ./mysql/time_zone_leap_second.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_leap_second.MYD 151029 15:39:49 [01] ...done 151029 15:39:49 [01] Copying ./mysql/help_topic.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_topic.MYD 151029 15:39:49 [01] ...done 151029 15:39:50 [01] Copying ./mysql/help_topic.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_topic.MYI 151029 15:39:50 [01] ...done 151029 15:39:50 [01] Copying ./mysql/db.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/db.frm 151029 15:39:50 [01] ...done 151029 15:39:50 >> log scanned up to (14489531) 151029 15:39:50 [01] Copying ./mysql/func.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/func.MYI 151029 15:39:50 [01] ...done 151029 15:39:50 [01] Copying ./mysql/procs_priv.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/procs_priv.MYI 151029 15:39:50 [01] ...done 151029 15:39:50 [01] Copying ./mysql/help_category.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_category.frm 151029 15:39:50 [01] ...done 151029 15:39:50 [01] Copying ./mysql/procs_priv.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/procs_priv.frm 151029 15:39:50 [01] ...done 151029 15:39:50 [01] Copying ./mysql/func.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/func.MYD 151029 15:39:50 [01] ...done 151029 15:39:50 [01] Copying ./mysql/func.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/func.frm 151029 15:39:50 [01] ...done 151029 15:39:51 [01] Copying ./mysql/proc.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/proc.MYI 151029 15:39:51 [01] ...done 151029 15:39:51 [01] Copying ./mysql/general_log.CSM to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/general_log.CSM 151029 15:39:51 [01] ...done 151029 15:39:51 [01] Copying ./mysql/time_zone.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone.MYI 151029 15:39:51 >> log scanned up to (14489531) 151029 15:39:51 [01] ...done 151029 15:39:51 [01] Copying ./mysql/slave_master_info.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/slave_master_info.frm 151029 15:39:51 [01] ...done 151029 15:39:51 [01] Copying ./mysql/innodb_table_stats.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/innodb_table_stats.frm 151029 15:39:51 [01] ...done 151029 15:39:51 [01] Copying ./performance_schema/users.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/users.frm 151029 15:39:51 [01] ...done 151029 15:39:51 [01] Copying ./performance_schema/events_waits_history_long.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_waits_history_long.frm 151029 15:39:51 [01] ...done 151029 15:39:51 [01] Copying ./performance_schema/events_statements_summary_by_host_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_statements_summary_by_host_by_event_name.frm 151029 15:39:51 [01] ...done 151029 15:39:51 [01] Copying ./performance_schema/table_io_waits_summary_by_index_usage.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/table_io_waits_summary_by_index_usage.frm 151029 15:39:51 [01] ...done 151029 15:39:52 [01] Copying ./performance_schema/events_waits_history.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_waits_history.frm 151029 15:39:52 [01] ...done 151029 15:39:52 [01] Copying ./performance_schema/host_cache.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/host_cache.frm 151029 15:39:52 [01] ...done 151029 15:39:52 [01] Copying ./performance_schema/events_statements_summary_by_thread_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_statements_summary_by_thread_by_event_name.frm 151029 15:39:52 [01] ...done 151029 15:39:52 >> log scanned up to (14489531) 151029 15:39:52 [01] Copying ./performance_schema/session_connect_attrs.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/session_connect_attrs.frm 151029 15:39:52 [01] ...done 151029 15:39:52 [01] Copying ./performance_schema/objects_summary_global_by_type.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/objects_summary_global_by_type.frm 151029 15:39:52 [01] ...done 151029 15:39:52 [01] Copying ./performance_schema/session_account_connect_attrs.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/session_account_connect_attrs.frm 151029 15:39:52 [01] ...done 151029 15:39:52 [01] Copying ./performance_schema/socket_summary_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/socket_summary_by_event_name.frm 151029 15:39:52 [01] ...done 151029 15:39:52 [01] Copying ./performance_schema/events_stages_summary_global_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_stages_summary_global_by_event_name.frm 151029 15:39:52 [01] ...done 151029 15:39:53 [01] Copying ./performance_schema/rwlock_instances.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/rwlock_instances.frm 151029 15:39:53 [01] ...done 151029 15:39:53 [01] Copying ./performance_schema/events_stages_current.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_stages_current.frm 151029 15:39:53 [01] ...done 151029 15:39:53 [01] Copying ./performance_schema/file_summary_by_instance.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/file_summary_by_instance.frm 151029 15:39:53 [01] ...done 151029 15:39:53 >> log scanned up to (14489531) 151029 15:39:53 [01] Copying ./performance_schema/events_waits_summary_by_host_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_waits_summary_by_host_by_event_name.frm 151029 15:39:53 [01] ...done 151029 15:39:53 [01] Copying ./performance_schema/performance_timers.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/performance_timers.frm 151029 15:39:53 [01] ...done 151029 15:39:53 [01] Copying ./performance_schema/events_waits_summary_by_thread_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_waits_summary_by_thread_by_event_name.frm 151029 15:39:53 [01] ...done 151029 15:39:53 [01] Copying ./performance_schema/events_waits_summary_by_user_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_waits_summary_by_user_by_event_name.frm 151029 15:39:53 [01] ...done 151029 15:39:53 [01] Copying ./performance_schema/cond_instances.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/cond_instances.frm 151029 15:39:53 [01] ...done 151029 15:39:53 [01] Copying ./performance_schema/events_statements_summary_global_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_statements_summary_global_by_event_name.frm 151029 15:39:53 [01] ...done 151029 15:39:54 [01] Copying ./performance_schema/setup_timers.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/setup_timers.frm 151029 15:39:54 [01] ...done 151029 15:39:54 [01] Copying ./performance_schema/hosts.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/hosts.frm 151029 15:39:54 [01] ...done 151029 15:39:54 >> log scanned up to (14489531) 151029 15:39:54 [01] Copying ./performance_schema/socket_summary_by_instance.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/socket_summary_by_instance.frm 151029 15:39:54 [01] ...done 151029 15:39:54 [01] Copying ./performance_schema/file_instances.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/file_instances.frm 151029 15:39:54 [01] ...done 151029 15:39:54 [01] Copying ./performance_schema/table_lock_waits_summary_by_table.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/table_lock_waits_summary_by_table.frm 151029 15:39:54 [01] ...done 151029 15:39:54 [01] Copying ./performance_schema/events_statements_summary_by_user_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_statements_summary_by_user_by_event_name.frm 151029 15:39:54 [01] ...done 151029 15:39:54 [01] Copying ./performance_schema/events_waits_current.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_waits_current.frm 151029 15:39:55 [01] ...done 151029 15:39:55 [01] Copying ./performance_schema/events_statements_summary_by_digest.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_statements_summary_by_digest.frm 151029 15:39:55 [01] ...done 151029 15:39:55 [01] Copying ./performance_schema/events_stages_history.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_stages_history.frm 151029 15:39:55 [01] ...done 151029 15:39:55 >> log scanned up to (14489531) 151029 15:39:55 [01] Copying ./performance_schema/file_summary_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/file_summary_by_event_name.frm 151029 15:39:55 [01] ...done 151029 15:39:55 [01] Copying ./performance_schema/table_io_waits_summary_by_table.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/table_io_waits_summary_by_table.frm 151029 15:39:55 [01] ...done 151029 15:39:55 [01] Copying ./performance_schema/events_stages_summary_by_thread_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_stages_summary_by_thread_by_event_name.frm 151029 15:39:55 [01] ...done 151029 15:39:55 [01] Copying ./performance_schema/threads.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/threads.frm 151029 15:39:55 [01] ...done 151029 15:39:55 [01] Copying ./performance_schema/accounts.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/accounts.frm 151029 15:39:55 [01] ...done 151029 15:39:56 [01] Copying ./performance_schema/events_waits_summary_global_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_waits_summary_global_by_event_name.frm 151029 15:39:56 [01] ...done 151029 15:39:56 [01] Copying ./performance_schema/setup_objects.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/setup_objects.frm 151029 15:39:56 [01] ...done 151029 15:39:56 [01] Copying ./performance_schema/events_statements_current.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_statements_current.frm 151029 15:39:56 [01] ...done 151029 15:39:56 >> log scanned up to (14489531) 151029 15:39:56 [01] Copying ./performance_schema/socket_instances.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/socket_instances.frm 151029 15:39:56 [01] ...done 151029 15:39:56 [01] Copying ./performance_schema/setup_actors.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/setup_actors.frm 151029 15:39:56 [01] ...done 151029 15:39:56 [01] Copying ./performance_schema/events_stages_summary_by_account_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_stages_summary_by_account_by_event_name.frm 151029 15:39:56 [01] ...done 151029 15:39:56 [01] Copying ./performance_schema/events_stages_summary_by_host_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_stages_summary_by_host_by_event_name.frm 151029 15:39:56 [01] ...done 151029 15:39:56 [01] Copying ./performance_schema/db.opt to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/db.opt 151029 15:39:56 [01] ...done 151029 15:39:57 [01] Copying ./performance_schema/events_stages_summary_by_user_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_stages_summary_by_user_by_event_name.frm 151029 15:39:57 [01] ...done 151029 15:39:57 [01] Copying ./performance_schema/events_statements_history.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_statements_history.frm 151029 15:39:57 [01] ...done 151029 15:39:57 [01] Copying ./performance_schema/events_waits_summary_by_account_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_waits_summary_by_account_by_event_name.frm 151029 15:39:57 [01] ...done 151029 15:39:57 >> log scanned up to (14489531) 151029 15:39:57 [01] Copying ./performance_schema/events_waits_summary_by_instance.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_waits_summary_by_instance.frm 151029 15:39:57 [01] ...done 151029 15:39:57 [01] Copying ./performance_schema/setup_consumers.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/setup_consumers.frm 151029 15:39:57 [01] ...done 151029 15:39:57 [01] Copying ./performance_schema/setup_instruments.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/setup_instruments.frm 151029 15:39:57 [01] ...done 151029 15:39:57 [01] Copying ./performance_schema/mutex_instances.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/mutex_instances.frm 151029 15:39:57 [01] ...done 151029 15:39:57 [01] Copying ./performance_schema/events_statements_history_long.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_statements_history_long.frm 151029 15:39:57 [01] ...done 151029 15:39:57 [01] Copying ./performance_schema/events_statements_summary_by_account_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_statements_summary_by_account_by_event_name.frm 151029 15:39:58 [01] ...done 151029 15:39:58 [01] Copying ./performance_schema/events_stages_history_long.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_stages_history_long.frm 151029 15:39:58 [01] ...done 151029 15:39:58 Finished backing up non-InnoDB tables and files 151029 15:39:58 Executing LOCK BINLOG FOR BACKUP... 151029 15:39:58 Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS... xtrabackup: The latest check point (for incremental): '14489531' xtrabackup: Stopping log copying thread. .151029 15:39:58 >> log scanned up to (14489531) 151029 15:39:58 Executing UNLOCK BINLOG 151029 15:39:58 Executing UNLOCK TABLES 151029 15:39:58 All tables unlocked 151029 15:39:58 Backup created in directory '/data/mysql/backup/full/2015-10-29_15-39-38' 151029 15:39:58 [00] Writing backup-my.cnf 151029 15:39:58 [00] ...done 151029 15:39:58 [00] Writing xtrabackup_info 151029 15:39:58 [00] ...done xtrabackup: Transaction log of lsn (14489531) to (14489531) was copied. 151029 15:39:58 completed OK!
把所有那些合在一起的备份进行应用,并回滚未提交的事务:
[root@rh64 full]# innobackupex --user='bakusr' --password='oracle' --apply-log --use-memory=1g /data/mysql/backup/full
151029 16:31:54 innobackupex: Starting the apply-log operation IMPORTANT: Please check that the apply-log run completes successfully. At the end of a successful apply-log run innobackupex prints "completed OK!". innobackupex version 2.3.2 based on MySQL server 5.6.24 Linux (x86_64) (revision id: 306a2e0) xtrabackup: cd to /data/mysql/backup/full xtrabackup: This target seems to be already prepared. xtrabackup: notice: xtrabackup_logfile was already used to '--prepare'. xtrabackup: using the following InnoDB configuration for recovery: xtrabackup: innodb_data_home_dir = ./ xtrabackup: innodb_data_file_path = ibdata1:12M;ibdata2:10M:autoextend xtrabackup: innodb_log_group_home_dir = ./ xtrabackup: innodb_log_files_in_group = 2 xtrabackup: innodb_log_file_size = 50331648 xtrabackup: using the following InnoDB configuration for recovery: xtrabackup: innodb_data_home_dir = ./ xtrabackup: innodb_data_file_path = ibdata1:12M;ibdata2:10M:autoextend xtrabackup: innodb_log_group_home_dir = ./ xtrabackup: innodb_log_files_in_group = 2 xtrabackup: innodb_log_file_size = 50331648 xtrabackup: Starting InnoDB instance for recovery. xtrabackup: Using 1073741824 bytes for buffer pool (set by --use-memory parameter) InnoDB: Using atomics to ref count buffer pool pages InnoDB: The InnoDB memory heap is disabled InnoDB: Mutexes and rw_locks use GCC atomic builtins InnoDB: Memory barrier is not used InnoDB: Compressed tables use zlib 1.2.3 InnoDB: Using CPU crc32 instructions InnoDB: Initializing buffer pool, size = 1.0G InnoDB: Completed initialization of buffer pool InnoDB: Highest supported file format is Barracuda. InnoDB: 128 rollback segment(s) are active. InnoDB: Waiting for purge to start InnoDB: 5.6.24 started; log sequence number 13254698 xtrabackup: starting shutdown with innodb_fast_shutdown = 1 InnoDB: FTS optimize thread exiting. InnoDB: Starting shutdown... InnoDB: Shutdown completed; log sequence number 13254708 xtrabackup: using the following InnoDB configuration for recovery: xtrabackup: innodb_data_home_dir = ./ xtrabackup: innodb_data_file_path = ibdata1:12M;ibdata2:10M:autoextend xtrabackup: innodb_log_group_home_dir = ./ xtrabackup: innodb_log_files_in_group = 2 xtrabackup: innodb_log_file_size = 50331648 InnoDB: Using atomics to ref count buffer pool pages InnoDB: The InnoDB memory heap is disabled InnoDB: Mutexes and rw_locks use GCC atomic builtins InnoDB: Memory barrier is not used InnoDB: Compressed tables use zlib 1.2.3 InnoDB: Using CPU crc32 instructions InnoDB: Initializing buffer pool, size = 1.0G InnoDB: Completed initialization of buffer pool InnoDB: Highest supported file format is Barracuda. InnoDB: 128 rollback segment(s) are active. InnoDB: Waiting for purge to start InnoDB: 5.6.24 started; log sequence number 13254708 xtrabackup: starting shutdown with innodb_fast_shutdown = 1 InnoDB: FTS optimize thread exiting. InnoDB: Starting shutdown... InnoDB: Shutdown completed; log sequence number 13254718 151029 16:31:58 completed OK!
3、把恢复完的备份数据拷贝到数据库数据存储的目录下:
1)关闭数据库
[root@rh64 inc_2]# mysqladmin shutdown -u root -p
Enter password:
[root@rh64 inc_2]# netstat -an |grep :3306
[root@rh64 inc_2]# mysqladmin status
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
建立新的数据库存储目录:
[root@rh64 inc_2]# mv mysql mysql.old
[root@rh64 inc_2]# mkdir -p /var/lib/mysql
查看最近的备份:
[root@rh64 full]# ls -lt
total 122928
-rw-r----- 1 root root 12582912 Oct 29 16:55 ibdata1 -rw-r----- 1 root root 10485760 Oct 29 16:55 ibdata2 -rw-r--r-- 1 root root 50331648 Oct 29 16:55 ib_logfile0 -rw-r----- 1 root root 115 Oct 29 16:55 xtrabackup_checkpoints drwx------ 6 root root 4096 Oct 29 16:54 2015-10-29_16-54-06 drwx------ 6 root root 4096 Oct 29 16:53 2015-10-29_16-53-16 drwx------ 4 root root 4096 Oct 29 16:52 2015-10-29_16-52-46 drwx------ 2 root root 4096 Oct 29 16:51 2015-10-29_16-51-54 drwx------ 2 root root 4096 Oct 29 16:50 2015-10-29_16-50-51 -rw-r--r-- 1 root root 50331648 Oct 29 16:49 ib_logfile1 -rw-r----- 1 root root 2097152 Oct 29 16:49 xtrabackup_logfile -rw-r----- 1 root root 524 Oct 29 16:43 xtrabackup_info -rw-r----- 1 root root 398 Oct 29 16:43 backup-my.cnf drwx------ 2 root root 4096 Oct 29 16:43 performance_schema drwx------ 2 root root 4096 Oct 29 16:43 mysql drwx------ 2 root root 4096 Oct 29 16:43 test drwx------ 2 root root 4096 Oct 29 16:43 prod
选择最后合成的备份目录:2015-10-29_16-54-06
拷贝备份数据到数据库存储目录:
[root@rh64 lib]# innobackupex --default-files=/tmp/my.cnf --copy-back --resync /data/mysql/backup/full/2015-10-29_16-54-06
151029 15:45:46 innobackupex: Starting the copy-back operation IMPORTANT: Please check that the copy-back run completes successfully. At the end of a successful copy-back run innobackupex prints "completed OK!". innobackupex version 2.3.2 based on MySQL server 5.6.24 Linux (x86_64) (revision id: 306a2e0) 151029 15:45:46 [01] Copying ib_logfile0 to /var/lib/mysql/ib_logfile0 151029 15:45:46 [01] ...done 151029 15:45:47 [01] Copying ib_logfile1 to /var/lib/mysql/ib_logfile1 151029 15:45:47 [01] ...done 151029 15:45:48 [01] Copying ibdata1 to /var/lib/mysql/ibdata1 151029 15:45:49 [01] ...done 151029 15:45:49 [01] Copying ibdata2 to /var/lib/mysql/ibdata2 151029 15:45:49 [01] ...done 151029 15:45:49 [01] Copying ./2015-10-29_15-39-38/xtrabackup_info to /var/lib/mysql/2015-10-29_15-39-38/xtrabackup_info 151029 15:45:49 [01] ...done 151029 15:45:49 [01] Copying ./2015-10-29_15-37-38/xtrabackup_info to /var/lib/mysql/2015-10-29_15-37-38/xtrabackup_info 151029 15:45:49 [01] ...done 151029 15:45:50 [01] Copying ./prod/t1.frm to /var/lib/mysql/prod/t1.frm 151029 15:45:50 [01] ...done 151029 15:45:50 [01] Copying ./prod/t2.ibd to /var/lib/mysql/prod/t2.ibd 151029 15:45:50 [01] ...done 151029 15:45:50 [01] Copying ./prod/t2.frm to /var/lib/mysql/prod/t2.frm 151029 15:45:50 [01] ...done 151029 15:45:50 [01] Copying ./prod/t1.ibd to /var/lib/mysql/prod/t1.ibd 151029 15:45:50 [01] ...done 151029 15:45:51 [01] Copying ./prod/t3.frm to /var/lib/mysql/prod/t3.frm 151029 15:45:51 [01] ...done 151029 15:45:51 [01] Copying ./prod/db.opt to /var/lib/mysql/prod/db.opt 151029 15:45:51 [01] ...done 151029 15:45:51 [01] Copying ./prod/t3.ibd to /var/lib/mysql/prod/t3.ibd 151029 15:45:51 [01] ...done 151029 15:45:51 [01] Creating directory /var/lib/mysql/2015-10-29_15-36-34 151029 15:45:51 [01] ...done.151029 15:45:51 [01] Creating directory /var/lib/mysql/2015-10-29_15-34-59 151029 15:45:51 [01] ...done.151029 15:45:51 [01] Copying ./test/db.opt to /var/lib/mysql/test/db.opt 151029 15:45:51 [01] ...done 151029 15:45:51 [01] Copying ./mysql/time_zone_name.MYD to /var/lib/mysql/mysql/time_zone_name.MYD 151029 15:45:51 [01] ...done 151029 15:45:51 [01] Copying ./mysql/help_topic.frm to /var/lib/mysql/mysql/help_topic.frm 151029 15:45:51 [01] ...done 151029 15:45:51 [01] Copying ./mysql/event.frm to /var/lib/mysql/mysql/event.frm 151029 15:45:51 [01] ...done 151029 15:45:51 [01] Copying ./mysql/time_zone.MYD to /var/lib/mysql/mysql/time_zone.MYD 151029 15:45:51 [01] ...done 151029 15:45:51 [01] Copying ./mysql/slow_log.CSV to /var/lib/mysql/mysql/slow_log.CSV 151029 15:45:51 [01] ...done 151029 15:45:51 [01] Copying ./mysql/innodb_index_stats.frm to /var/lib/mysql/mysql/innodb_index_stats.frm 151029 15:45:51 [01] ...done 151029 15:45:51 [01] Copying ./mysql/columns_priv.MYI to /var/lib/mysql/mysql/columns_priv.MYI 151029 15:45:52 [01] ...done 151029 15:45:52 [01] Copying ./mysql/plugin.MYI to /var/lib/mysql/mysql/plugin.MYI 151029 15:45:52 [01] ...done 151029 15:45:52 [01] Copying ./mysql/time_zone_leap_second.frm to /var/lib/mysql/mysql/time_zone_leap_second.frm 151029 15:45:52 [01] ...done 151029 15:45:52 [01] Copying ./mysql/time_zone_transition_type.MYI to /var/lib/mysql/mysql/time_zone_transition_type.MYI 151029 15:45:52 [01] ...done 151029 15:45:52 [01] Copying ./mysql/proc.frm to /var/lib/mysql/mysql/proc.frm 151029 15:45:52 [01] ...done 151029 15:45:52 [01] Copying ./mysql/procs_priv.MYD to /var/lib/mysql/mysql/procs_priv.MYD 151029 15:45:52 [01] ...done 151029 15:45:52 [01] Copying ./mysql/proxies_priv.MYI to /var/lib/mysql/mysql/proxies_priv.MYI 151029 15:45:52 [01] ...done 151029 15:45:52 [01] Copying ./mysql/slave_worker_info.ibd to /var/lib/mysql/mysql/slave_worker_info.ibd 151029 15:45:52 [01] ...done 151029 15:45:52 [01] Copying ./mysql/ndb_binlog_index.MYI to /var/lib/mysql/mysql/ndb_binlog_index.MYI 151029 15:45:52 [01] ...done 151029 15:45:53 [01] Copying ./mysql/servers.MYI to /var/lib/mysql/mysql/servers.MYI 151029 15:45:53 [01] ...done 151029 15:45:53 [01] Copying ./mysql/slow_log.frm to /var/lib/mysql/mysql/slow_log.frm 151029 15:45:53 [01] ...done 151029 15:45:53 [01] Copying ./mysql/help_relation.MYD to /var/lib/mysql/mysql/help_relation.MYD 151029 15:45:53 [01] ...done 151029 15:45:53 [01] Copying ./mysql/user.frm to /var/lib/mysql/mysql/user.frm 151029 15:45:53 [01] ...done 151029 15:45:53 [01] Copying ./mysql/plugin.frm to /var/lib/mysql/mysql/plugin.frm 151029 15:45:53 [01] ...done 151029 15:45:53 [01] Copying ./mysql/time_zone_name.frm to /var/lib/mysql/mysql/time_zone_name.frm 151029 15:45:53 [01] ...done 151029 15:45:53 [01] Copying ./mysql/user.MYI to /var/lib/mysql/mysql/user.MYI 151029 15:45:53 [01] ...done 151029 15:45:53 [01] Copying ./mysql/slave_master_info.ibd to /var/lib/mysql/mysql/slave_master_info.ibd 151029 15:45:53 [01] ...done 151029 15:45:54 [01] Copying ./mysql/help_relation.frm to /var/lib/mysql/mysql/help_relation.frm 151029 15:45:54 [01] ...done 151029 15:45:54 [01] Copying ./mysql/slow_log.CSM to /var/lib/mysql/mysql/slow_log.CSM 151029 15:45:54 [01] ...done 151029 15:45:54 [01] Copying ./mysql/time_zone_transition.MYD to /var/lib/mysql/mysql/time_zone_transition.MYD 151029 15:45:54 [01] ...done 151029 15:45:54 [01] Copying ./mysql/help_category.MYI to /var/lib/mysql/mysql/help_category.MYI 151029 15:45:54 [01] ...done 151029 15:45:54 [01] Copying ./mysql/proc.MYD to /var/lib/mysql/mysql/proc.MYD 151029 15:45:54 [01] ...done 151029 15:45:54 [01] Copying ./mysql/slave_relay_log_info.ibd to /var/lib/mysql/mysql/slave_relay_log_info.ibd 151029 15:45:54 [01] ...done 151029 15:45:54 [01] Copying ./mysql/db.MYD to /var/lib/mysql/mysql/db.MYD 151029 15:45:54 [01] ...done 151029 15:45:54 [01] Copying ./mysql/tables_priv.MYD to /var/lib/mysql/mysql/tables_priv.MYD 151029 15:45:54 [01] ...done 151029 15:45:54 [01] Copying ./mysql/time_zone_leap_second.MYI to /var/lib/mysql/mysql/time_zone_leap_second.MYI 151029 15:45:54 [01] ...done 151029 15:45:55 [01] Copying ./mysql/help_relation.MYI to /var/lib/mysql/mysql/help_relation.MYI 151029 15:45:55 [01] ...done 151029 15:45:55 [01] Copying ./mysql/ndb_binlog_index.MYD to /var/lib/mysql/mysql/ndb_binlog_index.MYD 151029 15:45:55 [01] ...done 151029 15:45:55 [01] Copying ./mysql/slave_worker_info.frm to /var/lib/mysql/mysql/slave_worker_info.frm 151029 15:45:55 [01] ...done 151029 15:45:55 [01] Copying ./mysql/time_zone.frm to /var/lib/mysql/mysql/time_zone.frm 151029 15:45:55 [01] ...done 151029 15:45:55 [01] Copying ./mysql/slave_relay_log_info.frm to /var/lib/mysql/mysql/slave_relay_log_info.frm 151029 15:45:55 [01] ...done 151029 15:45:55 [01] Copying ./mysql/columns_priv.MYD to /var/lib/mysql/mysql/columns_priv.MYD 151029 15:45:55 [01] ...done 151029 15:45:55 [01] Copying ./mysql/time_zone_transition_type.MYD to /var/lib/mysql/mysql/time_zone_transition_type.MYD 151029 15:45:55 [01] ...done 151029 15:45:55 [01] Copying ./mysql/user.MYD to /var/lib/mysql/mysql/user.MYD 151029 15:45:55 [01] ...done 151029 15:45:55 [01] Copying ./mysql/tables_priv.frm to /var/lib/mysql/mysql/tables_priv.frm 151029 15:45:55 [01] ...done 151029 15:45:56 [01] Copying ./mysql/help_category.MYD to /var/lib/mysql/mysql/help_category.MYD 151029 15:45:56 [01] ...done 151029 15:45:56 [01] Copying ./mysql/help_keyword.MYD to /var/lib/mysql/mysql/help_keyword.MYD 151029 15:45:56 [01] ...done 151029 15:45:56 [01] Copying ./mysql/time_zone_transition.frm to /var/lib/mysql/mysql/time_zone_transition.frm 151029 15:45:56 [01] ...done 151029 15:45:56 [01] Copying ./mysql/servers.frm to /var/lib/mysql/mysql/servers.frm 151029 15:45:56 [01] ...done 151029 15:45:56 [01] Copying ./mysql/general_log.frm to /var/lib/mysql/mysql/general_log.frm 151029 15:45:56 [01] ...done 151029 15:45:56 [01] Copying ./mysql/help_keyword.frm to /var/lib/mysql/mysql/help_keyword.frm 151029 15:45:56 [01] ...done 151029 15:45:56 [01] Copying ./mysql/time_zone_transition_type.frm to /var/lib/mysql/mysql/time_zone_transition_type.frm 151029 15:45:56 [01] ...done 151029 15:45:56 [01] Copying ./mysql/columns_priv.frm to /var/lib/mysql/mysql/columns_priv.frm 151029 15:45:56 [01] ...done 151029 15:45:57 [01] Copying ./mysql/proxies_priv.frm to /var/lib/mysql/mysql/proxies_priv.frm 151029 15:45:57 [01] ...done 151029 15:45:57 [01] Copying ./mysql/help_keyword.MYI to /var/lib/mysql/mysql/help_keyword.MYI 151029 15:45:57 [01] ...done 151029 15:45:57 [01] Copying ./mysql/general_log.CSV to /var/lib/mysql/mysql/general_log.CSV 151029 15:45:57 [01] ...done 151029 15:45:57 [01] Copying ./mysql/event.MYD to /var/lib/mysql/mysql/event.MYD 151029 15:45:57 [01] ...done 151029 15:45:57 [01] Copying ./mysql/plugin.MYD to /var/lib/mysql/mysql/plugin.MYD 151029 15:45:57 [01] ...done 151029 15:45:57 [01] Copying ./mysql/proxies_priv.MYD to /var/lib/mysql/mysql/proxies_priv.MYD 151029 15:45:57 [01] ...done 151029 15:45:57 [01] Copying ./mysql/servers.MYD to /var/lib/mysql/mysql/servers.MYD 151029 15:45:57 [01] ...done 151029 15:45:57 [01] Copying ./mysql/innodb_index_stats.ibd to /var/lib/mysql/mysql/innodb_index_stats.ibd 151029 15:45:57 [01] ...done 151029 15:45:57 [01] Copying ./mysql/event.MYI to /var/lib/mysql/mysql/event.MYI 151029 15:45:57 [01] ...done 151029 15:45:58 [01] Copying ./mysql/time_zone_transition.MYI to /var/lib/mysql/mysql/time_zone_transition.MYI 151029 15:45:58 [01] ...done 151029 15:45:58 [01] Copying ./mysql/tables_priv.MYI to /var/lib/mysql/mysql/tables_priv.MYI 151029 15:45:58 [01] ...done 151029 15:45:58 [01] Copying ./mysql/ndb_binlog_index.frm to /var/lib/mysql/mysql/ndb_binlog_index.frm 151029 15:45:58 [01] ...done 151029 15:45:58 [01] Copying ./mysql/db.MYI to /var/lib/mysql/mysql/db.MYI 151029 15:45:58 [01] ...done 151029 15:45:58 [01] Copying ./mysql/time_zone_name.MYI to /var/lib/mysql/mysql/time_zone_name.MYI 151029 15:45:58 [01] ...done 151029 15:45:58 [01] Copying ./mysql/time_zone_leap_second.MYD to /var/lib/mysql/mysql/time_zone_leap_second.MYD 151029 15:45:58 [01] ...done 151029 15:45:58 [01] Copying ./mysql/help_topic.MYD to /var/lib/mysql/mysql/help_topic.MYD 151029 15:45:58 [01] ...done 151029 15:45:58 [01] Copying ./mysql/help_topic.MYI to /var/lib/mysql/mysql/help_topic.MYI 151029 15:45:58 [01] ...done 151029 15:45:59 [01] Copying ./mysql/db.frm to /var/lib/mysql/mysql/db.frm 151029 15:45:59 [01] ...done 151029 15:45:59 [01] Copying ./mysql/func.MYI to /var/lib/mysql/mysql/func.MYI 151029 15:45:59 [01] ...done 151029 15:45:59 [01] Copying ./mysql/procs_priv.MYI to /var/lib/mysql/mysql/procs_priv.MYI 151029 15:45:59 [01] ...done 151029 15:45:59 [01] Copying ./mysql/help_category.frm to /var/lib/mysql/mysql/help_category.frm 151029 15:45:59 [01] ...done 151029 15:45:59 [01] Copying ./mysql/procs_priv.frm to /var/lib/mysql/mysql/procs_priv.frm 151029 15:45:59 [01] ...done 151029 15:45:59 [01] Copying ./mysql/func.MYD to /var/lib/mysql/mysql/func.MYD 151029 15:45:59 [01] ...done 151029 15:45:59 [01] Copying ./mysql/func.frm to /var/lib/mysql/mysql/func.frm 151029 15:45:59 [01] ...done 151029 15:45:59 [01] Copying ./mysql/proc.MYI to /var/lib/mysql/mysql/proc.MYI 151029 15:45:59 [01] ...done 151029 15:46:00 [01] Copying ./mysql/innodb_table_stats.ibd to /var/lib/mysql/mysql/innodb_table_stats.ibd 151029 15:46:00 [01] ...done 151029 15:46:00 [01] Copying ./mysql/general_log.CSM to /var/lib/mysql/mysql/general_log.CSM 151029 15:46:00 [01] ...done 151029 15:46:00 [01] Copying ./mysql/time_zone.MYI to /var/lib/mysql/mysql/time_zone.MYI 151029 15:46:00 [01] ...done 151029 15:46:00 [01] Copying ./mysql/slave_master_info.frm to /var/lib/mysql/mysql/slave_master_info.frm 151029 15:46:00 [01] ...done 151029 15:46:00 [01] Copying ./mysql/innodb_table_stats.frm to /var/lib/mysql/mysql/innodb_table_stats.frm 151029 15:46:00 [01] ...done 151029 15:46:00 [01] Copying ./performance_schema/users.frm to /var/lib/mysql/performance_schema/users.frm 151029 15:46:00 [01] ...done 151029 15:46:00 [01] Copying ./performance_schema/events_waits_history_long.frm to /var/lib/mysql/performance_schema/events_waits_history_long.frm 151029 15:46:00 [01] ...done 151029 15:46:00 [01] Copying ./performance_schema/events_statements_summary_by_host_by_event_name.frm to /var/lib/mysql/performance_schema/events_statements_summary_by_host_by_event_name.frm 151029 15:46:00 [01] ...done 151029 15:46:00 [01] Copying ./performance_schema/table_io_waits_summary_by_index_usage.frm to /var/lib/mysql/performance_schema/table_io_waits_summary_by_index_usage.frm 151029 15:46:00 [01] ...done 151029 15:46:01 [01] Copying ./performance_schema/events_waits_history.frm to /var/lib/mysql/performance_schema/events_waits_history.frm 151029 15:46:01 [01] ...done 151029 15:46:01 [01] Copying ./performance_schema/host_cache.frm to /var/lib/mysql/performance_schema/host_cache.frm 151029 15:46:01 [01] ...done 151029 15:46:01 [01] Copying ./performance_schema/events_statements_summary_by_thread_by_event_name.frm to /var/lib/mysql/performance_schema/events_statements_summary_by_thread_by_event_name.frm 151029 15:46:01 [01] ...done 151029 15:46:01 [01] Copying ./performance_schema/session_connect_attrs.frm to /var/lib/mysql/performance_schema/session_connect_attrs.frm 151029 15:46:01 [01] ...done 151029 15:46:01 [01] Copying ./performance_schema/objects_summary_global_by_type.frm to /var/lib/mysql/performance_schema/objects_summary_global_by_type.frm 151029 15:46:01 [01] ...done 151029 15:46:01 [01] Copying ./performance_schema/session_account_connect_attrs.frm to /var/lib/mysql/performance_schema/session_account_connect_attrs.frm 151029 15:46:01 [01] ...done 151029 15:46:01 [01] Copying ./performance_schema/socket_summary_by_event_name.frm to /var/lib/mysql/performance_schema/socket_summary_by_event_name.frm 151029 15:46:01 [01] ...done 151029 15:46:01 [01] Copying ./performance_schema/events_stages_summary_global_by_event_name.frm to /var/lib/mysql/performance_schema/events_stages_summary_global_by_event_name.frm 151029 15:46:01 [01] ...done 151029 15:46:02 [01] Copying ./performance_schema/rwlock_instances.frm to /var/lib/mysql/performance_schema/rwlock_instances.frm 151029 15:46:02 [01] ...done 151029 15:46:02 [01] Copying ./performance_schema/events_stages_current.frm to /var/lib/mysql/performance_schema/events_stages_current.frm 151029 15:46:02 [01] ...done 151029 15:46:02 [01] Copying ./performance_schema/file_summary_by_instance.frm to /var/lib/mysql/performance_schema/file_summary_by_instance.frm 151029 15:46:02 [01] ...done 151029 15:46:02 [01] Copying ./performance_schema/events_waits_summary_by_host_by_event_name.frm to /var/lib/mysql/performance_schema/events_waits_summary_by_host_by_event_name.frm 151029 15:46:02 [01] ...done 151029 15:46:02 [01] Copying ./performance_schema/performance_timers.frm to /var/lib/mysql/performance_schema/performance_timers.frm 151029 15:46:02 [01] ...done 151029 15:46:02 [01] Copying ./performance_schema/events_waits_summary_by_thread_by_event_name.frm to /var/lib/mysql/performance_schema/events_waits_summary_by_thread_by_event_name.frm 151029 15:46:02 [01] ...done 151029 15:46:02 [01] Copying ./performance_schema/events_waits_summary_by_user_by_event_name.frm to /var/lib/mysql/performance_schema/events_waits_summary_by_user_by_event_name.frm 151029 15:46:02 [01] ...done 151029 15:46:02 [01] Copying ./performance_schema/cond_instances.frm to /var/lib/mysql/performance_schema/cond_instances.frm 151029 15:46:03 [01] ...done 151029 15:46:03 [01] Copying ./performance_schema/events_statements_summary_global_by_event_name.frm to /var/lib/mysql/performance_schema/events_statements_summary_global_by_event_name.frm 151029 15:46:03 [01] ...done 151029 15:46:03 [01] Copying ./performance_schema/setup_timers.frm to /var/lib/mysql/performance_schema/setup_timers.frm 151029 15:46:03 [01] ...done 151029 15:46:03 [01] Copying ./performance_schema/hosts.frm to /var/lib/mysql/performance_schema/hosts.frm 151029 15:46:03 [01] ...done 151029 15:46:03 [01] Copying ./performance_schema/socket_summary_by_instance.frm to /var/lib/mysql/performance_schema/socket_summary_by_instance.frm 151029 15:46:03 [01] ...done 151029 15:46:03 [01] Copying ./performance_schema/file_instances.frm to /var/lib/mysql/performance_schema/file_instances.frm 151029 15:46:03 [01] ...done 151029 15:46:03 [01] Copying ./performance_schema/table_lock_waits_summary_by_table.frm to /var/lib/mysql/performance_schema/table_lock_waits_summary_by_table.frm 151029 15:46:03 [01] ...done 151029 15:46:03 [01] Copying ./performance_schema/events_statements_summary_by_user_by_event_name.frm to /var/lib/mysql/performance_schema/events_statements_summary_by_user_by_event_name.frm 151029 15:46:03 [01] ...done 151029 15:46:04 [01] Copying ./performance_schema/events_waits_current.frm to /var/lib/mysql/performance_schema/events_waits_current.frm 151029 15:46:04 [01] ...done 151029 15:46:04 [01] Copying ./performance_schema/events_statements_summary_by_digest.frm to /var/lib/mysql/performance_schema/events_statements_summary_by_digest.frm 151029 15:46:04 [01] ...done 151029 15:46:04 [01] Copying ./performance_schema/events_stages_history.frm to /var/lib/mysql/performance_schema/events_stages_history.frm 151029 15:46:04 [01] ...done 151029 15:46:04 [01] Copying ./performance_schema/file_summary_by_event_name.frm to /var/lib/mysql/performance_schema/file_summary_by_event_name.frm 151029 15:46:04 [01] ...done 151029 15:46:04 [01] Copying ./performance_schema/table_io_waits_summary_by_table.frm to /var/lib/mysql/performance_schema/table_io_waits_summary_by_table.frm 151029 15:46:04 [01] ...done 151029 15:46:04 [01] Copying ./performance_schema/events_stages_summary_by_thread_by_event_name.frm to /var/lib/mysql/performance_schema/events_stages_summary_by_thread_by_event_name.frm 151029 15:46:04 [01] ...done 151029 15:46:04 [01] Copying ./performance_schema/threads.frm to /var/lib/mysql/performance_schema/threads.frm 151029 15:46:04 [01] ...done 151029 15:46:04 [01] Copying ./performance_schema/accounts.frm to /var/lib/mysql/performance_schema/accounts.frm 151029 15:46:04 [01] ...done 151029 15:46:05 [01] Copying ./performance_schema/events_waits_summary_global_by_event_name.frm to /var/lib/mysql/performance_schema/events_waits_summary_global_by_event_name.frm 151029 15:46:05 [01] ...done 151029 15:46:05 [01] Copying ./performance_schema/setup_objects.frm to /var/lib/mysql/performance_schema/setup_objects.frm 151029 15:46:05 [01] ...done 151029 15:46:05 [01] Copying ./performance_schema/events_statements_current.frm to /var/lib/mysql/performance_schema/events_statements_current.frm 151029 15:46:05 [01] ...done 151029 15:46:05 [01] Copying ./performance_schema/socket_instances.frm to /var/lib/mysql/performance_schema/socket_instances.frm 151029 15:46:05 [01] ...done 151029 15:46:05 [01] Copying ./performance_schema/setup_actors.frm to /var/lib/mysql/performance_schema/setup_actors.frm 151029 15:46:05 [01] ...done 151029 15:46:05 [01] Copying ./performance_schema/events_stages_summary_by_account_by_event_name.frm to /var/lib/mysql/performance_schema/events_stages_summary_by_account_by_event_name.frm 151029 15:46:05 [01] ...done 151029 15:46:05 [01] Copying ./performance_schema/events_stages_summary_by_host_by_event_name.frm to /var/lib/mysql/performance_schema/events_stages_summary_by_host_by_event_name.frm 151029 15:46:05 [01] ...done 151029 15:46:05 [01] Copying ./performance_schema/db.opt to /var/lib/mysql/performance_schema/db.opt 151029 15:46:05 [01] ...done 151029 15:46:06 [01] Copying ./performance_schema/events_stages_summary_by_user_by_event_name.frm to /var/lib/mysql/performance_schema/events_stages_summary_by_user_by_event_name.frm 151029 15:46:06 [01] ...done 151029 15:46:06 [01] Copying ./performance_schema/events_statements_history.frm to /var/lib/mysql/performance_schema/events_statements_history.frm 151029 15:46:06 [01] ...done 151029 15:46:06 [01] Copying ./performance_schema/events_waits_summary_by_account_by_event_name.frm to /var/lib/mysql/performance_schema/events_waits_summary_by_account_by_event_name.frm 151029 15:46:06 [01] ...done 151029 15:46:06 [01] Copying ./performance_schema/events_waits_summary_by_instance.frm to /var/lib/mysql/performance_schema/events_waits_summary_by_instance.frm 151029 15:46:06 [01] ...done 151029 15:46:06 [01] Copying ./performance_schema/setup_consumers.frm to /var/lib/mysql/performance_schema/setup_consumers.frm 151029 15:46:06 [01] ...done 151029 15:46:06 [01] Copying ./performance_schema/setup_instruments.frm to /var/lib/mysql/performance_schema/setup_instruments.frm 151029 15:46:06 [01] ...done 151029 15:46:06 [01] Copying ./performance_schema/mutex_instances.frm to /var/lib/mysql/performance_schema/mutex_instances.frm 151029 15:46:06 [01] ...done 151029 15:46:07 [01] Copying ./performance_schema/events_statements_history_long.frm to /var/lib/mysql/performance_schema/events_statements_history_long.frm 151029 15:46:07 [01] ...done 151029 15:46:07 [01] Copying ./performance_schema/events_statements_summary_by_account_by_event_name.frm to /var/lib/mysql/performance_schema/events_statements_summary_by_account_by_event_name.frm 151029 15:46:07 [01] ...done 151029 15:46:07 [01] Copying ./performance_schema/events_stages_history_long.frm to /var/lib/mysql/performance_schema/events_stages_history_long.frm 151029 15:46:07 [01] ...done 151029 15:46:07 [01] Copying ./xtrabackup_info to /var/lib/mysql/xtrabackup_info 151029 15:46:07 [01] ...done 151029 15:46:07 completed OK!
备份数据拷贝完成,启动数据库:
更改新的数据存储目录的属性:
[root@rh64 lib]# ls -l mysql
total 120868
drwx------ 2 root root 4096 Oct 29 15:45 2015-10-29_15-34-59 drwx------ 2 root root 4096 Oct 29 15:45 2015-10-29_15-36-34 drwx------ 2 root root 4096 Oct 29 15:45 2015-10-29_15-37-38 drwx------ 2 root root 4096 Oct 29 15:45 2015-10-29_15-39-38 -rw-r----- 1 root root 12582912 Oct 29 15:45 ibdata1 -rw-r----- 1 root root 10485760 Oct 29 15:45 ibdata2 -rw-r----- 1 root root 50331648 Oct 29 15:45 ib_logfile0 -rw-r----- 1 root root 50331648 Oct 29 15:45 ib_logfile1 drwx------ 2 root root 4096 Oct 29 15:46 mysql drwx------ 2 root root 4096 Oct 29 15:46 performance_schema drwx------ 2 root root 4096 Oct 29 15:45 prod drwx------ 2 root root 4096 Oct 29 15:45 test -rw-r----- 1 root root 524 Oct 29 15:46 xtrabackup_info
[root@rh64 lib]# ls -ld mysql.old
drwxr-xr-x 6 mysql mysql 4096 Oct 29 15:43 mysql.old
[root@rh64 lib]# chown -R mysql:mysql mysql
[root@rh64 lib]# ls -l mysql
total 120868 drwx------ 2 mysql mysql 4096 Oct 29 15:45 2015-10-29_15-34-59 drwx------ 2 mysql mysql 4096 Oct 29 15:45 2015-10-29_15-36-34 drwx------ 2 mysql mysql 4096 Oct 29 15:45 2015-10-29_15-37-38 drwx------ 2 mysql mysql 4096 Oct 29 15:45 2015-10-29_15-39-38 -rw-r----- 1 mysql mysql 12582912 Oct 29 15:45 ibdata1 -rw-r----- 1 mysql mysql 10485760 Oct 29 15:45 ibdata2 -rw-r----- 1 mysql mysql 50331648 Oct 29 15:45 ib_logfile0 -rw-r----- 1 mysql mysql 50331648 Oct 29 15:45 ib_logfile1 drwx------ 2 mysql mysql 4096 Oct 29 15:46 mysql drwx------ 2 mysql mysql 4096 Oct 29 15:46 performance_schema drwx------ 2 mysql mysql 4096 Oct 29 15:45 prod drwx------ 2 mysql mysql 4096 Oct 29 15:45 test -rw-r----- 1 mysql mysql 524 Oct 29 15:46 xtrabackup_info
[root@rh64 lib]# service mysql start
Starting MySQL (Percona Server)..[ OK ]
连接数据库,查看数据恢复:
[root@rh64 lib]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.25-73.1 Percona Server (GPL), Release 73.1, Revision 07b797f Copyright (c) 2009-2015 Percona LLC and/or its affiliates Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use prod
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select count(*) from t1;
+----------+
| count(*) |
+----------+
| 118304 |
+----------+
1 row in set (0.20 sec)
----数据恢复完成 !!!