Mysql – innobackupex is failing while exporting backup

backupMySQLmysql-5.5perconaxtrabackup

I am using perl script which is working fine in one of my other box which used to take individual schema backups & finally take all schema together using percona innobackupex.

I have following information in the Log(posting One day Log details):

--slave-info is used with --no-lock but without --safe-slave-backup. The
binlog position cannot be consistent with the backup data.
Died at /apps/mysql/scripts/mysql_backup.pl line 214.

  [Fri Oct 26 04:20:01 2012] [14670]
  [Fri Oct 26 04:20:01 2012] [14670] Starting individual backups
  [Fri Oct 26 04:20:01 2012] [14670]
  [Fri Oct 26 04:20:01 2012] [14670] Backing up proddb
  [Fri Oct 26 04:20:01 2012] [14670] Creating /tmp/mysql_backup-14670.fifo
  [Fri Oct 26 04:20:01 2012] [14670] Starting /usr/local/bin/zipmt -s -t 4 
  -c - < /tmp/mysql_backup-14670.fifo > /apps/dbbackup/proddb02.backup-
  2012-10-26-042001-proddb.dmp.bz2
  [Fri Oct 26 04:20:01 2012] [14670] Starting /usr/bin/innobackupex 
  --slave-info --no-lock --stream=tar --databases proddb ./ >
  /tmp/mysql_backup-14670.fifo
  [Fri Oct 26 04:20:02 2012] [14670] FAIL: /usr/bin/innobackupex 
  --slave-info --no-lock --stream=tar --databases proddb ./ > 
  /tmp/mysql_backup-14670.fifo failed 256

Full details are in /apps/dbbackup/backup.log.

 Cause:
   /usr/bin/innobackupex --slave-info --no-lock --stream=tar --databases
  proddb ./ > /tmp/mysql_backup-14670.fifo failed 256

Named pipes are existing in the /tmp even after backup getting failed :

  ls -lrth /tmp 
  =============

 prw-r--r--. 1 root root    0 Oct 25 04:20 mysql_backup-18215.fifo
 prw-r--r--. 1 root root    0 Oct 26 04:20 mysql_backup-14670.fifo
 prw-r--r--. 1 root root    0 Oct 27 04:20 mysql_backup-11278.fifo
 prw-r--r--. 1 root root    0 Oct 28 04:20 mysql_backup-7163.fifo
 prw-r--r--. 1 root root    0 Oct 29 04:20 mysql_backup-4191.fifo
 prw-r--r--. 1 root root    0 Oct 30 04:20 mysql_backup-595.fifo

Any idea, why the backup is failing?

Best Answer

Try with option: --safe-slave-backup

This is for consistent backup on the slave machines.
This option basically stops the slave SQL activity dueing the backup 
of individual DBs.
You will see slave SQL thread error and initilization messages 
regularly during the backup.

Hope this helps. Please let us know back on the results...