我们正在使用MyIsam引擎运行,并且在跳过inndb引擎时,Percona-xtrabackup会抛出以下错误[my.cnf skip-innodb]。 我怎样才能解决这个问题,以启用inndb引擎?
percona-xtrabackup-2.0.0/bin:# ./innobackupex-1.5.1 --user="root" --password=*** --defaults-file="/etc/my.cnf" --socket=<path>/mysql.sock1 --ibbackup=<path>/percona-xtrabackup-2.0.0/bin/xtrabackup <path>/testbackup/
This software is published under the GNU GENERAL PUBLIC LICENSE Version 2, June 1991. IMPORTANT: Please check that the backup run completes successfully. At the end of a successful backup run innobackupex-1.5.1 prints "completed OK!". innobackupex-1.5.1: Using mysql Ver 14.14 Distrib 5.1.57, for pc-linux-gnu (i686) using readline 5.1 innobackupex-1.5.1: Using mysql server version Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. innobackupex-1.5.1: Created backup directory <path>/testbackup/2012-06-08_16-55-23 120608 16:55:23 innobackupex-1.5.1: Starting mysql with options: --defaults-file='/etc/my.cnf' --password=xxxxxxxx --user='root' --socket='/data/mysql1/mysql.sock1' --unbuffered -- 120608 16:55:23 innobackupex-1.5.1: Connected to database with mysql child process (pid=25611) 120608 16:55:25 innobackupex-1.5.1: Connection to database server closed 120608 16:55:25 innobackupex-1.5.1: Starting ibbackup with command: <path>/percona-xtrabackup-2.0.0/bin/xtrabackup --defaults-file="/etc/my.cnf" --backup --suspend-at-end --target-dir=<path>/testbackup/2012-06-08_16-55-23 innobackupex-1.5.1: Waiting for ibbackup (pid=25618) to suspend innobackupex-1.5.1: Suspend file '<path>/testbackup/2012-06-08_16-55-23/xtrabackup_suspended' <path>/percona-xtrabackup-2.0.0/bin/xtrabackup version 2.0.0 for Percona Server 5.1.59 pc-linux-gnu (i686) (revision id: undefined) xtrabackup: uses posix_fadvise(). xtrabackup: cd to /data/mysql1 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 InnoDB: The first specified data file ./ibdata1 did not exist: InnoDB: a new database to be created! 120608 16:55:26 InnoDB: Setting file ./ibdata1 size to 10 MB InnoDB: Database physically writes the file full: wait... xtrabackup: Something wrong with source files... innobackupex-1.5.1: Error: ibbackup child process has died at ./innobackupex-1.5.1 line 371.
有没有理由使用它? 它将只是lockingmyiasm表转储。 它真的是innodb表的工具,可以做myiasm,但它locking它们。 也可能只是做一个服务器宽锁,并复制所有的文件。
在MyISAM-only安装上使用innobackupex没有任何意义。 这是为什么。
innobackupex旨在从正在运行的数据库创build一致的备份; 所谓的“热备份”。 这只对InnoDB表空间没有干扰,因为MyISAM需要你对表进行一个READ LOCK来进行一致的备份,只要这个锁没有被释放,就会导致服务中断。
您拥有的MyISAM数据越多, innobackupex将locking您的表的时间innobackupex多。 只有MyISAM数据,使用这个工具是没有意义的 – 它将和
mysql> FLUSH TABLES WITH READ LOCK shell> cp -a /path/to/datadir/of/mysql /path/to-backup/dir mysql> UNLOCK TABLES 。 而InnoDB innobackupex刚刚开始复制,然后在稍后准备更新( --apply-log )时使用事务--apply-log ,脱机/独立。
如果您拒绝对InnoDB进行更改,因为您认为这个过程很困难,那么请使用以下代码:
mysql -u root --password=<password> --database=db_name -B -N -e "SHOW TABLES" | awk '!/not_this_db/ && !/or_this_one/ && /^[az]/ {print "ALTER TABLE", $1, "ENGINE=INNODB;"}' | mysql -u root --password=<password> --database=db_name
你可以用正则expression式来排除和包含数据库,例如上面的例子中只有以小写字母开头的dbs。
当然,更改会locking表,但是你可以从那里使用xtrabackup。
在启用skip-innodb的新创build的数据库上运行innobackupex时,遇到了同样的问题。 看起来innobackupex需要在那里有一个function性的InnoDB存储引擎,即使它没有被使用,并且在为你生成一个InnoDB时会出错。
用#skip-innodb在我的/etc/my.cnf中注释掉了一次数据库后(我必须删除ibdata1文件备份脚本,因为它已经损坏了),然后closures它,取消注释skip-innodb行,备份脚本按预期工作。
我猜测人们不会再遇到这种情况了,因为有人仍然只能运行MyISAM数据库。