innobackupex备份与xtrabackup备份对比

来源:互联网 发布:反射原理java 编辑:程序博客网 时间:2024/06/17 02:41

innobackup备份时,会启动xtrabackup相关脚本,如下:

innobackupex --socket=/home/mysql/run/mysql.sock --user=root --password=123456  /tmp... ...innobackupex: Starting ibbackup with command: xtrabackup_56  --defaults-group="mysqld" --backup --suspend-at-end --target-dir=/tmp/2015-08-14_16-39-57 --tmpdir=/tmpinnobackupex: Waiting for ibbackup (pid=38180) to suspendinnobackupex: Suspend file '/tmp/2015-08-14_16-39-57/xtrabackup_suspended_2'... ...

xtra全备

xtrabackup --backup --target-dir=/tmp-rw-r-----. 1 root root 146800640 Aug 14 17:35 ibdata1drwx------. 2 root root      4096 Aug 14 17:35 mtmsdrwx------. 2 root root      4096 Aug 14 17:35 bbpdrwx------. 2 root root      4096 Aug 14 17:35 lmisdrwx------. 2 root root      4096 Aug 14 17:35 testdrwx------. 2 root root      4096 Aug 14 17:35 mysql-rw-r-----. 1 root root      2560 Aug 14 17:35 xtrabackup_logfile-rw-r-----. 1 root root        97 Aug 14 17:35 xtrabackup_checkpointsll lmistotal 61536-rw-r-----. 1 root root    98304 Aug 14 17:35 md_goods_type.ibd-rw-r-----. 1 root root 62914560 Aug 14 17:35 md_product.ibd
inno全备

innobackupex --socket=/home/mysql/run/mysql.sock --user=root --password=123456  /tmpll /tmp-rw-r--r--. 1 root root        57 Aug 14 16:39 percona-version-checkdrwxr-xr-x. 9 root root      4096 Aug 14 16:40 2015-08-14_16-39-57ll /tmp/2015-08-14_16-39-57-rw-r--r--. 1 root root       359 Aug 14 16:39 backup-my.cnfdrwx------. 2 root root      4096 Aug 14 16:40 bbp-rw-r-----. 1 root root 146800640 Aug 14 16:40 ibdata1drwx------. 2 root root      4096 Aug 14 16:40 lmisdrwx------. 2 root root      4096 Aug 14 16:40 mtmsdrwxr-xr-x. 2 root root      4096 Aug 14 16:40 myisamdrwx------. 2 root root      4096 Aug 14 16:40 mysqldrwxr-xr-x. 2 root root      4096 Aug 14 16:40 performance_schemadrwx------. 2 root root      4096 Aug 14 16:40 test-rw-r--r--. 1 root root        13 Aug 14 16:40 xtrabackup_binary-rw-r--r--. 1 root root        23 Aug 14 16:40 xtrabackup_binlog_info-rw-r-----. 1 root root        97 Aug 14 16:40 xtrabackup_checkpoints-rw-r-----. 1 root root      2560 Aug 14 16:40 xtrabackup_logfilell /tmp/2015-08-14_16-39-57/lmis-rw-r-----. 1 root root       61 Aug 14 16:40 db.opt-rw-r-----. 1 root root     8918 Aug 14 16:40 md_goods_type.frm-rw-r-----. 1 root root    98304 Aug 14 16:40 md_goods_type.ibd-rw-r-----. 1 root root    14557 Aug 14 16:40 md_product.frm-rw-r-----. 1 root root 62914560 Aug 14 16:40 md_product.ibdcat /tmp/2015-08-14_16-39-57/backup-my.cnf# This MySQL options file was generated by innobackupex.# The MySQL server[mysqld]innodb_checksum_algorithm=innodbinnodb_log_checksum_algorithm=innodbinnodb_data_file_path=ibdata1:10M:autoextendinnodb_log_files_in_group=2innodb_log_file_size=1073741824innodb_fast_checksum=0innodb_page_size=16384innodb_log_block_size=512innodb_undo_tablespaces=0

innobackupex与xtrabackup的区别:

1、inno备份包含myisam引擎的表(performance_schema和myisam两个库表都为myisam引擎),但注意会加锁

2、inno会备份库信息(db.opt文件)及frm表(.frm文件)结构

3、inno备份的backup-my.cnf文件记录innodb的一些参数

4、inno备份binlog相关信息

所以一般使用innobackupex进行数据库备份。



0 0
原创粉丝点击