标签:数据库mysql 运行 类型 比较 mysq rest 选项 enabled nlog
(root@localhost)[(none)]mysql>show grants for ‘bkpuser‘@‘localhost‘\G *************************** 1. row *************************** Grants for bkpuser@localhost: GRANT RELOAD, PROCESS, SUPER, LOCK TABLES, REPLICATION CLIENT, CREATE TABLESPACE ON *.* TO ‘bkpuser‘@‘localhost‘ IDENTIFIED BY PASSWORD ‘*BDC62F68AF8F0B8BFAE27FF782C5D8CE9F4BAFCB‘ 1 row in set (0.00 sec)
2. innobackupex 命令选项:
[root@localhost ~]# innobackupex --apply-log /backup/xtrabackup/full/ --user=bkpuser --password=digdeep 151106 10:41:48 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 (i686) (revision id: 306a2e0) xtrabackup: cd to /backup/xtrabackup/full xtrabackup: Error: cannot open ./xtrabackup_checkpoints xtrabackup: error: xtrabackup_read_metadata() xtrabackup: This target seems not to have correct metadata... 2015-11-06 10:41:48 b771e6d0 InnoDB: Operating system error number 2 in a file operation. InnoDB: The error means the system cannot find the path specified. xtrabackup: Warning: cannot open ./xtrabackup_logfile. will try to find. 2015-11-06 10:41:48 b771e6d0 InnoDB: Operating system error number 2 in a file operation. InnoDB: The error means the system cannot find the path specified. xtrabackup: Fatal error: cannot find ./xtrabackup_logfile. xtrabackup: Error: xtrabackup_init_temp_log() failed.
[root@localhost mysql]# innobackupex --copy-back /backup/xtrabackup/full/2015-11-05_22-38-55/ --user=bkpuser --password=digdeep 151106 11:07:38 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 (i686) (revision id: 306a2e0) 151106 11:07:38 [01] Copying ib_logfile0 to /var/lib/mysql/ib_logfile0 151106 11:07:40 [01] ...done 151106 11:07:40 [01] Copying ib_logfile1 to /var/lib/mysql/ib_logfile1 151106 11:07:41 [01] ...done 151106 11:07:41 [01] Copying ibdata1 to /var/lib/mysql/ibdata1 151106 11:07:45 [01] ...done 151106 11:07:45 [01] Copying ./xtrabackup_info to /var/lib/mysql/xtrabackup_info 151106 11:07:45 [01] ...done 151106 11:07:45 [01] Copying ./mysql/slave_master_info.ibd to /var/lib/mysql/mysql/slave_master_info.ibd 151106 11:07:45 [01] ...done [... ...] 151106 11:07:57 [01] Copying ./t/db.opt to /var/lib/mysql/t/db.opt 151106 11:07:57 [01] ...done 151106 11:07:57 [01] Copying ./t/t.frm to /var/lib/mysql/t/t.frm 151106 11:07:57 [01] ...done 151106 11:07:57 completed OK! [root@localhost mysql]# pwd /var/lib/mysql [root@localhost mysql]# ls aazj ibdata1 ib_logfile0 ib_logfile1 mysql performance_schema t xtrabackup_binlog_pos_innodb xtrabackup_info
[root@localhost mysql]# ls -l total 176164 drwx------ 2 root root 4096 Nov 6 11:07 aazj -rw-rw---- 1 mysql mysql 543 Nov 6 11:13 general.log -rw-r----- 1 root root 79691776 Nov 6 11:07 ibdata1 -rw-r----- 1 root root 50331648 Nov 6 11:07 ib_logfile0 -rw-r----- 1 root root 50331648 Nov 6 11:07 ib_logfile1 -rw-rw---- 1 mysql mysql 543 Nov 6 11:13 localhost-slow.log drwx------ 2 root root 4096 Nov 6 11:07 mysql -rw-rw---- 1 mysql mysql 0 Nov 6 11:12 mysql-bin.index drwx------ 2 root root 4096 Nov 6 11:07 performance_schema drwx------ 2 root root 4096 Nov 6 11:07 t -rw-r----- 1 root root 24 Nov 6 11:07 xtrabackup_binlog_pos_innodb -rw-r----- 1 root root 487 Nov 6 11:07 xtrabackup_info [root@localhost mysql]# chown -R mysql:mysql /var/lib/mysql [root@localhost mysql]# ls -l total 176164 drwx------ 2 mysql mysql 4096 Nov 6 11:07 aazj -rw-rw---- 1 mysql mysql 543 Nov 6 11:13 general.log -rw-r----- 1 mysql mysql 79691776 Nov 6 11:07 ibdata1 -rw-r----- 1 mysql mysql 50331648 Nov 6 11:07 ib_logfile0 -rw-r----- 1 mysql mysql 50331648 Nov 6 11:07 ib_logfile1 -rw-rw---- 1 mysql mysql 543 Nov 6 11:13 localhost-slow.log drwx------ 2 mysql mysql 4096 Nov 6 11:07 mysql -rw-rw---- 1 mysql mysql 0 Nov 6 11:12 mysql-bin.index drwx------ 2 mysql mysql 4096 Nov 6 11:07 performance_schema drwx------ 2 mysql mysql 4096 Nov 6 11:07 t -rw-r----- 1 mysql mysql 24 Nov 6 11:07 xtrabackup_binlog_pos_innodb -rw-r----- 1 mysql mysql 487 Nov 6 11:07 xtrabackup_info
[root@localhost mysql]# innobackupex --user=bkpuser --password=digdeep /backup/xtrabackup/full 第一次增量备份: --incremental /backup/xtrabackup/incr1/ 指定增量备份的位置; --incremental-basedir=指定上一次的全备或者增量备份: [root@localhost mysql]# innobackupex --incremental /backup/xtrabackup/incr1/ --incremental-basedir=/backup/xtrabackup/full/2015-11-06_11-29-51/ --user=bkpuser --password=digdeep 151106 11:33:16 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!". 151106 11:33:16 version_check Connecting to MySQL server with DSN ‘dbi:mysql:;mysql_read_default_group=xtrabackup;mysql_socket=/tmp/mysql.sock‘ as ‘bkpuser‘ (using password: YES). 151106 11:33:16 version_check Connected to MySQL server 151106 11:33:16 version_check Executing a version check against the server... 151106 11:33:16 version_check Done. 151106 11:33:16 Connecting to MySQL server host: localhost, user: bkpuser, password: set, port: 0, socket: /tmp/mysql.sock Using server version 5.6.26-log innobackupex version 2.3.2 based on MySQL server 5.6.24 Linux (i686) (revision id: 306a2e0) incremental backup from 731724832 is enabled. xtrabackup: uses posix_fadvise(). xtrabackup: cd to /var/lib/mysql xtrabackup: open files limit requested 0, set to 10240 xtrabackup: using the following InnoDB configuration: xtrabackup: innodb_data_home_dir = ./ xtrabackup: innodb_data_file_path = ibdata1:12M:autoextend xtrabackup: innodb_log_group_home_dir = ./ xtrabackup: innodb_log_files_in_group = 2 xtrabackup: innodb_log_file_size = 50331648 151106 11:33:16 >> log scanned up to (732153217) xtrabackup: Generating a list of tablespaces xtrabackup: using the full scan for incremental backup 151106 11:33:17 [01] Copying ./ibdata1 to /backup/xtrabackup/incr1//2015-11-06_11-33-16/ibdata1.delta 151106 11:33:17 >> log scanned up to (732153217) 151106 11:33:18 [01] ...done 151106 11:33:18 >> log scanned up to (732153217) 151106 11:33:18 [01] Copying ./mysql/slave_master_info.ibd to /backup/xtrabackup/incr1//2015-11-06_11-33-16/mysql/slave_master_info.ibd.delta 151106 11:33:18 [01] ...done 151106 11:33:19 >> log scanned up to (732153217) [... ...] 151106 11:33:30 [01] Copying ./aazj/Configuration.ibd to /backup/xtrabackup/incr1//2015-11-06_11-33-16/aazj/Configuration.ibd.delta 151106 11:33:30 [01] ...done 151106 11:33:31 [01] Copying ./aazj/lx_test.ibd to /backup/xtrabackup/incr1//2015-11-06_11-33-16/aazj/lx_test.ibd.delta 151106 11:33:31 >> log scanned up to (732231774) 151106 11:33:32 [01] ...done 151106 11:33:32 >> log scanned up to (732231774) 151106 11:33:32 [01] Copying ./aazj/Users.ibd to /backup/xtrabackup/incr1//2015-11-06_11-33-16/aazj/Users.ibd.delta 151106 11:33:32 [01] ...done [... ...] 151106 11:33:42 [01] Copying ./aazj/tttt.ibd to /backup/xtrabackup/incr1//2015-11-06_11-33-16/aazj/tttt.ibd.delta 151106 11:33:42 [01] ...done 151106 11:33:42 >> log scanned up to (732501432) 151106 11:33:42 [01] Copying ./aazj/uu_test.ibd to /backup/xtrabackup/incr1//2015-11-06_11-33-16/aazj/uu_test.ibd.delta [... ...] 151106 11:33:47 [01] Copying ./t/t.ibd to /backup/xtrabackup/incr1//2015-11-06_11-33-16/t/t.ibd.delta 151106 11:33:48 [01] ...done 151106 11:33:48 >> log scanned up to (732501432) Executing FLUSH NO_WRITE_TO_BINLOG TABLES... 151106 11:33:48 Executing FLUSH TABLES WITH READ LOCK... 151106 11:33:48 Starting to backup non-InnoDB tables and files 151106 11:33:48 [01] Copying ./mysql/columns_priv.frm to /backup/xtrabackup/incr1//2015-11-06_11-33-16/mysql/columns_priv.frm 151106 11:33:48 [01] ...done [... ...] 151106 11:33:51 [01] Copying ./t/t.frm to /backup/xtrabackup/incr1//2015-11-06_11-33-16/t/t.frm 151106 11:33:51 [01] ...done 151106 11:33:51 Finished backing up non-InnoDB tables and files 151106 11:33:51 [00] Writing xtrabackup_binlog_info 151106 11:33:51 [00] ...done 151106 11:33:51 Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS... xtrabackup: The latest check point (for incremental): ‘732501432‘ xtrabackup: Stopping log copying thread. .151106 11:33:51 >> log scanned up to (732501432) 151106 11:33:51 Executing UNLOCK TABLES 151106 11:33:51 All tables unlocked 151106 11:33:51 Backup created in directory ‘/backup/xtrabackup/incr1//2015-11-06_11-33-16‘ MySQL binlog position: filename ‘mysql-bin.000001‘, position ‘157893‘ 151106 11:33:51 [00] Writing backup-my.cnf 151106 11:33:51 [00] ...done 151106 11:33:51 [00] Writing xtrabackup_info 151106 11:33:51 [00] ...done xtrabackup: Transaction log of lsn (732153217) to (732501432) was copied. 151106 11:33:51 completed OK! [root@localhost mysql]#
[root@localhost mysql]# innobackupex --copy-back /backup/xtrabackup/full/2015-11-06_11-29-51/ --user=bkpuser --password=digdeep 151106 15:10:23 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 (i686) (revision id: 306a2e0) 151106 15:10:23 [01] Copying ibdata1 to /var/lib/mysql/ibdata1 151106 15:10:28 [01] ...done 151106 15:10:28 [01] Copying ./xtrabackup_info to /var/lib/mysql/xtrabackup_info 151106 15:10:28 [01] ...done [... ...] 151106 15:10:41 [01] ...done 151106 15:10:41 [01] Copying ./t/db.opt to /var/lib/mysql/t/db.opt 151106 15:10:41 [01] ...done 151106 15:10:41 [01] Copying ./t/t.frm to /var/lib/mysql/t/t.frm 151106 15:10:41 [01] ...done 151106 15:10:42 completed OK!
标签:数据库mysql 运行 类型 比较 mysq rest 选项 enabled nlog
原文地址:https://www.cnblogs.com/DataArt/p/10174576.html