用xtrabackup做mysql库的增量备份时报错如下:
xtrabackup: innodb_log_file_size = 5242880
InnoDB: Error: log file ./ib_logfile0 is of different size 0 524288000 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
innobackupex: Error: The xtrabackup child process has died at /usr/local/xtrabackup/bin/innobackupex line 2631.
解决方法:
在--defaults-file=/tmp/my.cnf 指定的配置文件里设置innodb_log_file_size值如下:
innodb_log_file_size=524288000
再次备份提示
innobackupex: Error: Failed to create backup directory /tol/backup/incremental_one: File exists at /usr/local/xtrabackup/bin/innobackupex line 3883.
删除相关目录:
[root@goolen ~]# rm -rf /tol/backup/incremental_one
再次备份成功:
[root@goolen ~]# innobackupex --user=backup --password=backup --socket=/tmp/mysql.sock --defaults-file=/tmp/my.cnf --incremental /tol/backup/incremental_one --incremental-basedir=/tol/backup/full --no-timestamp --parallel=2
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
141204 16:42:10 innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_file=/tmp/my.cnf;mysql_read_default_group=xtrabackup;mysql_socket=/tmp/mysql.sock' as 'backup' (using password: YES).
141204 16:42:10 innobackupex: Connected to MySQL server
141204 16:42:10 innobackupex: Executing a version check against the server...
141204 16:42:10 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.5.18-log
innobackupex: Created backup directory /tol/backup/incremental_one
141204 16:42:10 innobackupex: Starting ibbackup with command: xtrabackup_55 --defaults-file="/tmp/my.cnf" --defaults-group="mysqld" --backup --suspend-at-end --target-dir=/tol/backup/incremental_one --tmpdir=/tmp --incremental-basedir='/tol/backup/full' --parallel=2
innobackupex: Waiting for ibbackup (pid=28719) to suspend
innobackupex: Suspend file '/tol/backup/incremental_one/xtrabackup_suspended_2'
xtrabackup_55 version 2.1.6 for Percona Server 5.5.31 Linux (x86_64) (revision id: 702)
incremental backup from 555702796 is enabled.
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /tol/mysql/data/
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 = 524288000
>> log scanned up to (555702796)
141204 16:42:10 InnoDB: Warning: allocated tablespace 50, old maximum was 9
xtrabackup: Starting 2 threads for parallel data files transfer
[02] Copying ./goolen/tblsize.ibd to /tol/backup/incremental_one/goolen/tblsize.ibd.delta
[02] ...done
[01] Copying ./ibdata1 to /tol/backup/incremental_one/ibdata1.delta
[01] ...done
[02] Copying ./goolen/bigsize_table.ibd to /tol/backup/incremental_one/goolen/bigsize_table.ibd.delta
[02] ...done
[01] Copying ./test/t1.ibd to /tol/backup/incremental_one/test/t1.ibd.delta
[01] ...done
[02] Copying ./test/goolen2.ibd to /tol/backup/incremental_one/test/goolen2.ibd.delta
[02] ...done
[01] Copying ./test/goolen3.ibd to /tol/backup/incremental_one/test/goolen3.ibd.delta
[01] ...done
[02] Copying ./test/goolen.ibd to /tol/backup/incremental_one/test/goolen.ibd.delta
[02] ...done
>> log scanned up to (555702796)
xtrabackup: Creating suspend file '/tol/backup/incremental_one/xtrabackup_suspended_2' with pid '28719'
141204 16:42:12 innobackupex: Continuing after ibbackup has suspended
141204 16:42:12 innobackupex: Starting to lock all tables...
141204 16:42:12 innobackupex: All tables locked and flushed to disk
141204 16:42:12 innobackupex: Starting to backup non-InnoDB tables and files
innobackupex: in subdirectories of '/tol/mysql/data/'
innobackupex: Backing up file '/tol/mysql/data//mha/db.opt'
innobackupex: Backing up file '/tol/mysql/data//sso/db.opt'
>> log scanned up to (555702796)
innobackupex: Backing up file '/tol/mysql/data//exam/db.opt'
innobackupex: Backing up file '/tol/mysql/data//sb/sb1.MYI'
innobackupex: Backing up file '/tol/mysql/data//sb/sb2.frm'
innobackupex: Backing up file '/tol/mysql/data//sb/db.opt'
innobackupex: Backing up file '/tol/mysql/data//sb/sb2.MYD'
innobackupex: Backing up file '/tol/mysql/data//sb/sb1.frm'
innobackupex: Backing up file '/tol/mysql/data//sb/sb1.MYD'
innobackupex: Backing up file '/tol/mysql/data//sb/sb2.MYI'
innobackupex: Backing up file '/tol/mysql/data//fuck/db.opt'
innobackupex: Backing up file '/tol/mysql/data//goolen/g1.frm'
innobackupex: Backing up file '/tol/mysql/data//goolen/bigsize_table.frm'
innobackupex: Backing up file '/tol/mysql/data//goolen/db.opt'
innobackupex: Backing up file '/tol/mysql/data//goolen/tblsize.frm'
innobackupex: Backing up file '/tol/mysql/data//goolen/g1.MYD'
innobackupex: Backing up file '/tol/mysql/data//goolen/g1.MYI'
innobackupex: Backing up file '/tol/mysql/data//orders/db.opt'
innobackupex: Backing up files '/tol/mysql/data//mysql/*.{frm,isl,MYD,MYI,MAD,MAI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (72 files)
innobackupex: Backing up files '/tol/mysql/data//test/*.{frm,isl,MYD,MYI,MAD,MAI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (10 files)
innobackupex: Backing up file '/tol/mysql/data//cms/db.opt'
innobackupex: Backing up file '/tol/mysql/data//c2c/db.opt'
innobackupex: Backing up files '/tol/mysql/data//performance_schema/*.{frm,isl,MYD,MYI,MAD,MAI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (18 files)
innobackupex: Backing up file '/tol/mysql/data//ent/db.opt'
141204 16:42:13 innobackupex: Finished backing up non-InnoDB tables and files
141204 16:42:13 innobackupex: Waiting for log copying to finish
xtrabackup: The latest check point (for incremental): '555702796'
xtrabackup: Stopping log copying thread.
.>> log scanned up to (555702796)
xtrabackup: Creating suspend file '/tol/backup/incremental_one/xtrabackup_log_copied' with pid '28719'
xtrabackup: Transaction log of lsn (555702796) to (555702796) was copied.
141204 16:42:14 innobackupex: All tables unlocked
innobackupex: Backup created in directory '/tol/backup/incremental_one'
innobackupex: MySQL binlog position: filename 'mysql-bin.000021', position 341
141204 16:42:14 innobackupex: Connection to database server closed
141204 16:42:14 innobackupex: completed OK!
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23249684/viewspace-1356645/,如需转载,请注明出处,否则将追究法律责任。