innobackupex不同備份方式的記錄明細 [html] 普通備份模式 [root@Slave02 tmp]# innobackupex --database="inno test" --user=root --password=root --no-lock --defaults-file=/etc/my.cnf /data0/backup/mysql 2>/tmp/mysqlbackup.log xtrabackup_55 version 1.6.2 for MySQL server 5.5.10 Linux (i686) (revision id: undefined) [01] Copying ./ibdata1 to /data0/backup/mysql/2013-03-28_10-10-45/ibdata1 [01] ...done [01] Copying ./inno/mm.ibd to /data0/backup/mysql/2013-03-28_10-10-45/inno/mm.ibd [01] ...done [01] Copying ./inno/t.ibd to /data0/backup/mysql/2013-03-28_10-10-45/inno/t.ibd [01] ...done xtrabackup: The latest check point (for incremental): '893330831' xtrabackup: Stopping log copying thread. xtrabackup: Transaction log of lsn (893330831) to (893330831) was copied. [root@Slave02 tmp]# 注:使用mysql的root用戶將數據庫testinnodb和test的備份,備份路徑是/data0/backup/mysql/。備份 成功後會在該目錄下將創建以時間戳為名稱的備份目錄。no-lock參數用於指定備份時不鎖定表。2>/tmp/mysqlbackup.log是 將備份過程中的輸出信息保存到/tmp/mysqlbackup.log中 [root@Slave02 tmp]# cd /data0/backup/mysql/ ---校驗備份的文件 [root@Slave02 mysql]# ll total 20 drwxr-xr-x 4 root root 4096 Mar 28 10:11 2013-03-28_10-10-45 -rw-r--r-- 1 root root 83 Mar 28 10:10 stderr -rw-r--r-- 1 root root 0 Mar 28 10:10 stdout [root@Slave02 mysql]# cd 2013-03-28_10-10-45/ [root@Slave02 2013-03-28_10-10-45]# ll total 469520 -rw-r--r-- 1 root root 363 Mar 28 10:10 backup-my.cnf -rw-r--r-- 1 root root 480247808 Mar 28 10:11 ibdata1 drwx------ 2 root root 4096 Mar 28 10:11 inno -rw-r--r-- 1 root root 0 Mar 28 10:11 mysql-stderr -rw-r--r-- 1 root root 76 Mar 28 10:11 mysql-stdout drwxr-xr-x 2 root root 4096 Mar 28 10:11 test -rw-r--r-- 1 root root 13 Mar 28 10:11 xtrabackup_binary -rw-r--r-- 1 root root 81 Mar 28 10:11 xtrabackup_checkpoints -rw-r--r-- 1 root root 2560 Mar 28 10:11 xtrabackup_logfile [root@Slave02 2013-03-28_10-10-45]# cd inno/ [root@Slave02 inno]# ll total 2096 -rw-r----- 1 mysql mysql 8554 Mar 27 14:49 mm.frm -rw-r--r-- 1 root root 1048576 Mar 28 10:11 mm.ibd -rw-r----- 1 mysql mysql 8554 Mar 27 14:49 t.frm -rw-r--r-- 1 root root 1048576 Mar 28 10:11 t.ibd [root@Slave02 inno]# [root@Slave02 tmp]# cat mysqlbackup.log ----查看備份記錄的詳細過程 InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy and Percona Inc 2009-2011. All Rights Reserved. This software is published under the GNU GENERAL PUBLIC LICENSE Version 2, June 1991. 130328 10:10:39 innobackupex: Starting mysql with options: --defaults-file='/etc/my.cnf' --password='root' --user='root' --unbuffered -- 130328 10:10:39 innobackupex: Connected to database with mysql child process (pid=3714) 130328 10:10:45 innobackupex: Connection to database server closed IMPORTANT: Please check that the backup run completes successfully. At the end of a successful backup run innobackupex prints "completed OK!". innobackupex: Using mysql Ver 14.14 Distrib 5.5.13, for Linux (i686) using readline 5.1 innobackupex: Using mysql server version Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. innobackupex: Created backup directory /data0/backup/mysql/2013-03-28_10-10-45 130328 10:10:45 innobackupex: Starting mysql with options: --defaults-file='/etc/my.cnf' --password='root' --user='root' --unbuffered -- 130328 10:10:45 innobackupex: Connected to database with mysql child process (pid=3742) 130328 10:10:49 innobackupex: Connection to database server closed 130328 10:10:49 innobackupex: Starting ibbackup with command: xtrabackup_55 --defaults-file="/etc/my.cnf" --backup --suspend-at-end --target-dir=/data0/backup/mysql/2013-03-28_10-10-45 innobackupex: Waiting for ibbackup (pid=3754) to suspend innobackupex: Suspend file '/data0/backup/mysql/2013-03-28_10-10-45/xtrabackup_suspended' 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 130328 10:10:49 InnoDB: Using Linux native AIO 130328 10:10:50 InnoDB: Warning: allocated tablespace 2, old maximum was 0 >> log scanned up to (893330831) >> log scanned up to (893330831) >> log scanned up to (893330831) 130328 10:11:03 innobackupex: Continuing after ibbackup has suspended 130328 10:11:03 innobackupex: Starting mysql with options: --defaults-file='/etc/my.cnf' --password='root' --user='root' --unbuffered -- 130328 10:11:04 innobackupex: Connected to database with mysql child process (pid=3770) >> log scanned up to (893330831) 130328 10:11:08 innobackupex: Starting to backup .frm, .MRG, .MYD, .MYI, innobackupex: .TRG, .TRN, .ARM, .ARZ, .CSM, .CSV and .opt files in innobackupex: subdirectories of '/usr/local/mysql/data' innobackupex: Backing up file '/usr/local/mysql/data/inno/mm.frm' innobackupex: Backing up file '/usr/local/mysql/data/inno/t.frm' innobackupex: Backing up files '/usr/local/mysql/data/test/*.{frm,MYD,MYI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (19 files) 130328 10:11:08 innobackupex: Finished backing up .frm, .MRG, .MYD, .MYI, .TRG, .TRN, .ARM, .ARZ, .CSV, .CSM and .opt files innobackupex: Resuming ibbackup >> log scanned up to (893330831) 130328 10:11:09 innobackupex: Connection to database server closed innobackupex: Backup created in directory '/data0/backup/mysql/2013-03-28_10-10-45' 130328 10:11:09 innobackupex: completed OK! [root@Slave02 tmp]# 壓縮備份; [root@Slave02 inno]# innobackupex --database="inno test" --user=root --password =root --no-lock --defaults-file=/etc/my.cnf --stream=tar /data0/backup/mysql 2>/tmp/mysqlbackup.log|zip>/data0/backup/mysql/mike.tar.gz adding: - (deflated 63%) You have new mail in /var/spool/mail/root [root@Slave02 inno]# [root@Slave02 mysql]# ls 2013-03-28_10-10-45 mike.tar.gz stderr stdout xtrabackup_binary [root@Slave02 mysql]# ll total 176004 drwxr-xr-x 4 root root 4096 Mar 28 10:11 2013-03-28_10-10-45 -rw-r--r-- 1 root root 180012554 Mar 28 11:03 mike.tar.gz -rw-r--r-- 1 root root 83 Mar 28 10:10 stderr -rw-r--r-- 1 root root 0 Mar 28 10:10 stdout -rw-r--r-- 1 root root 13 Mar 28 11:03 xtrabackup_binary [root@Slave02 mysql]# ll -la total 176020 drwxr-xr-x 3 root root 4096 Mar 28 11:03 . drwxr-xr-x 3 root root 4096 Mar 28 09:48 .. drwxr-xr-x 4 root root 4096 Mar 28 10:11 2013-03-28_10-10-45 -rw-r--r-- 1 root root 180012554 Mar 28 11:03 mike.tar.gz -rw-r--r-- 1 root root 83 Mar 28 10:10 stderr -rw-r--r-- 1 root root 0 Mar 28 10:10 stdout -rw-r--r-- 1 root root 13 Mar 28 11:03 xtrabackup_binary [root@Slave02 mysql]#