How to install #innobackupex on #Gentoo Linux

Install xtrabackup-bin

# emerge -pvq xtrabackup-bin
[ebuild   R   ] dev-db/xtrabackup-bin-2.2.5 
# equery f xtrabackup-bin
 * Searching for xtrabackup-bin ...
 * Contents of dev-db/xtrabackup-bin-2.2.5:
/usr
/usr/bin
/usr/bin/innobackupex
/usr/bin/xbcrypt
/usr/bin/xbstream
/usr/bin/xtrabackup

Download and extract qpress

Download qpress-11-linux-x64.tar from this site:

Fast compression library for C, C# and Java

And extract qpress command.

# tar xvf qpress-11-linux-x64.tar -C /usr/local/bin/
qpress

Run innobackupex

  • Backup
# innobackupex --defaults-file=/etc/mysql/my.cnf --user=$USER --password=$PASS --ibbackup=xtrabackup --slave-info --safe-slave-backup --compress $TARGET_DIR
  • Restore
# innobackupex --user=$USER --password=$PASS --decompress $BACKUP_DIR
# innobackupex --user=$USER --password=$PASS --apply-log $BACKUP_DIR
# innobackupex --copy-back $BACKUP_DIR
# chown -R mysql:mysql /var/lib/mysql