xtrabackup 备份mysql数据库一 : 安装,准备环境



[root@promote tmp]# yum install cmake gcc gcc-c++ libaio libaio-devel automake autoconf bzr bison libtool ncurses-devel zlib-devel libgcrypt-devel


[root@promote tmp]#wget http://www.percona.com/downloads/XtraBackup/LATEST/binary/redhat/5/x86_64/percona-xtrabackup-2.2.3-4982.el5.x86_64.rpm


[root@promote tmp]# rpm -ivh percona-xtrabackup-2.1.9-744.rhel5.x86_64.rpm 


mysql> CREATE USER 'bkpuser'@'localhost' IDENTIFIED BY 's3cret';


mysql> GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO ’bkpuser’@’localhost’;


mysql> flush privileges;


innobackupex --user=root --password=mysql --defaults-file=/etc/my.cnf /backup

[mysql@promote local]$ innobackupex --user=root --password=mysql --defaults-file=/etc/my.cnf /backup


InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy

and Percona LLC and/or its affiliates 2009-2013.  All Rights Reserved.


This software is published under

the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.


Get the latest version of Percona XtraBackup, documentation, and help resources:

http://www.percona.com/xb/p


140612 11:28:29  innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_file=/etc/my.cnf;mysql_read_default_group=xtrabackup' as 'root'  (using password: YES).

140612 11:28:29  innobackupex: Connected to MySQL server

140612 11:28:29  innobackupex: Executing a version check against the server...

140612 11:28:29  innobackupex: Done.

IMPORTANT: Please check that the backup run completes successfully.

           At the end of a successful backup run innobackupex

           prints "completed OK!".


innobackupex: Using mysql server version 5.6.18-enterprise-commercial-advanced


innobackupex: Created backup directory /backup/2014-06-12_11-28-29


140612 11:28:29  innobackupex: Starting ibbackup with command: xtrabackup_56  --defaults-file="/etc/my.cnf"  --defaults-group="mysqld" --backup --suspend-at-end --target-dir=/backup/2014-06-12_11-28-29 --tmpdir=/tmp

innobackupex: Waiting for ibbackup (pid=27824) to suspend

innobackupex: Suspend file '/backup/2014-06-12_11-28-29/xtrabackup_suspended_2'


xtrabackup_56 version 2.1.9 for MySQL server 5.6.17 Linux (x86_64) (revision id: 744)

xtrabackup: uses posix_fadvise().

xtrabackup: cd to /usr/local/mysql/data

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:10M:autoextend

xtrabackup:   innodb_log_group_home_dir = ./

xtrabackup:   innodb_log_files_in_group = 2

xtrabackup:   innodb_log_file_size = 50331648

>> log scanned up to (3835126)

[01] Copying ./ibdata1 to /backup/2014-06-12_11-28-29/ibdata1

[01]        ...done

[01] Copying ./test/events_stages_summary_global_by_event_name.ibd to /backup/2014-06-12_11-28-29/test/events_stages_summary_global_by_event_name.ibd

[01]        ...done

[01] Copying ./test/itpub_B.ibd to /backup/2014-06-12_11-28-29/test/itpub_B.ibd

[01]        ...done

[01] Copying ./test/t_autoconnect.ibd to /backup/2014-06-12_11-28-29/test/t_autoconnect.ibd

[01]        ...done

[01] Copying ./test/events_stages_summary_global_by_event_name2.ibd to /backup/2014-06-12_11-28-29/test/events_stages_summary_global_by_event_name2.ibd

[01]        ...done

[01] Copying ./test/itpub_C.ibd to /backup/2014-06-12_11-28-29/test/itpub_C.ibd

[01]        ...done

[01] Copying ./test/itpub_A.ibd to /backup/2014-06-12_11-28-29/test/itpub_A.ibd

[01]        ...done

[01] Copying ./test/tc_reward_flow_map.ibd to /backup/2014-06-12_11-28-29/test/tc_reward_flow_map.ibd

[01]        ...done

[01] Copying ./mysql/slave_worker_info.ibd to /backup/2014-06-12_11-28-29/mysql/slave_worker_info.ibd

[01]        ...done

[01] Copying ./mysql/slave_master_info.ibd to /backup/2014-06-12_11-28-29/mysql/slave_master_info.ibd

[01]        ...done

[01] Copying ./mysql/slave_relay_log_info.ibd to /backup/2014-06-12_11-28-29/mysql/slave_relay_log_info.ibd

[01]        ...done

[01] Copying ./mysql/innodb_table_stats.ibd to /backup/2014-06-12_11-28-29/mysql/innodb_table_stats.ibd

[01]        ...done

[01] Copying ./mysql/innodb_index_stats.ibd to /backup/2014-06-12_11-28-29/mysql/innodb_index_stats.ibd

[01]        ...done

>> log scanned up to (3835126)

xtrabackup: Creating suspend file '/backup/2014-06-12_11-28-29/xtrabackup_suspended_2' with pid '27824'


140612 11:28:31  innobackupex: Continuing after ibbackup has suspended

140612 11:28:31  innobackupex: Starting to lock all tables...

140612 11:28:31  innobackupex: All tables locked and flushed to disk


140612 11:28:31  innobackupex: Starting to backup non-InnoDB tables and files

innobackupex: in subdirectories of '/usr/local/mysql/data'

innobackupex: Backing up file '/usr/local/mysql/data/test/itpub_B.frm'

innobackupex: Backing up file '/usr/local/mysql/data/test/db.opt'

>> log scanned up to (3835126)

innobackupex: Backing up file '/usr/local/mysql/data/test/itpub_A.frm'

innobackupex: Backing up file '/usr/local/mysql/data/test/events_stages_summary_global_by_event_name2.frm'

innobackupex: Backing up file '/usr/local/mysql/data/test/t_autoconnect.frm'

innobackupex: Backing up file '/usr/local/mysql/data/test/itpub_C.frm'

innobackupex: Backing up file '/usr/local/mysql/data/test/tc_reward_flow_map.frm'

innobackupex: Backing up file '/usr/local/mysql/data/test/events_stages_summary_global_by_event_name.frm'

innobackupex: Backing up files '/usr/local/mysql/data/mysql/*.{frm,isl,MYD,MYI,MAD,MAI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (74 files)

innobackupex: Backing up files '/usr/local/mysql/data/performance_schema/*.{frm,isl,MYD,MYI,MAD,MAI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (53 files)

140612 11:28:31  innobackupex: Finished backing up non-InnoDB tables and files


140612 11:28:31  innobackupex: Waiting for log copying to finish


xtrabackup: The latest check point (for incremental): '3835126'

xtrabackup: Stopping log copying thread.

.>> log scanned up to (3835126)


xtrabackup: Creating suspend file '/backup/2014-06-12_11-28-29/xtrabackup_log_copied' with pid '27824'

xtrabackup: Transaction log of lsn (3835126) to (3835126) was copied.

140612 11:28:32  innobackupex: All tables unlocked


innobackupex: Backup created in directory '/backup/2014-06-12_11-28-29'

140612 11:28:32  innobackupex: Connection to database server closed

140612 11:28:32  innobackupex: completed OK!


你可能感兴趣的:(数据库,mysql,备份)