Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
MySQL hot backup with Percona XtraBackup
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
hydrapolic
Tux's lil' helper
Tux's lil' helper


Joined: 07 Feb 2008
Posts: 112

PostPosted: Wed Aug 01, 2012 2:48 pm    Post subject: MySQL hot backup with Percona XtraBackup Reply with quote

MySQL hot backup with Percona XtraBackup

Code:

Percona XtraBackup is the world's only open-source, free MySQL hot backup software that performs non-blocking backups for InnoDB and XtraDB databases. With Percona XtraBackup, you can achieve the following benefits:

- Backups that complete quickly and reliably
- Uninterrupted transaction processing during backups
- Savings on disk space and network bandwidth
- Automatic backup verification
- Higher uptime due to faster restore time

XtraBackup makes MySQL hot backups for all versions of Percona Server, MySQL, MariaDB, and Drizzle. It performs streaming, compressed, and incremental MySQL backups.




  • fetch the ebuild from https://bugs.gentoo.org/show_bug.cgi?id=265407 (percona-xtrabackup-2.0.1.ebuild - https://bugs.gentoo.org/attachment.cgi?id=319980)
  • put it in a directory like /gentoo-overlay/dev-db/percona-xtrabackup/percona-xtrabackup-2.0.1.ebuild
  • create a manifest with ebuild: ebuild /gentoo-overlay/dev-db/percona-xtrabackup/percona-xtrabackup-2.0.1.ebuild manifest
  • edit /etc/make.conf and add: PORTDIR_OVERLAY="/gentoo-overlay"
  • set up your MySQL target in /etc/portage/package.use:

    mysql51 - MySQL 5.1 with bundled innodb
    mysql51plugin - MySQL 5.1 with innodb as plugin
    mysql55 - MySQL 5.5 (default)
    percona51 - Percona Xtradb 5.1
    percona55 - Percona Xtradb 5.5

  • you may only select one target and if you need something else then MySQL 5.5, unset it and set up your choice
  • emerge dev-db/percona-xtrabackup
  • depending on your selection, you will get a binary with the following name:
    MySQL 5.1 (builtin): xtrabackup_51
    MySQL 5.1 (plugin): xtrabackup_plugin
    MySQL 5.5: xtrabackup_innodb55
    Percona XtraDB 5.1: xtrabackup
    Percona XtraDB 5.5: xtrabackup_55

  • here is an example of backing up a MySQL 5.5 database:
    mkdir /backup-dir/
    innobackupex --user=john --password=FabulousPassword --defaults-file=/etc/mysql/my.cnf --ibbackup=/usr/bin/xtrabackup_innodb55 /backup-dir/
    innobackupex --apply-log --user=john --password=FabulousPassword --defaults-file=/etc/mysql/my.cnf --ibbackup=/usr/bin/xtrabackup_innodb55 /backup-dir/DATE/

  • if you wish to restore your database:
    innobackupex --ibbackup=/usr/bin/xtrabackup_innodb55 --copy-back /backup-dir/DATE/


or simply copy the content to your data directory (/var/lib/mysql) and chown mysql:mysql /var/lib/mysql


Let me know if it works for you.
Thank you !


Last edited by hydrapolic on Thu Aug 09, 2012 5:07 am; edited 1 time in total
Back to top
View user's profile Send private message
zeek
Guru
Guru


Joined: 16 Nov 2002
Posts: 478
Location: Bantayan Island

PostPosted: Wed Aug 08, 2012 9:14 pm    Post subject: Reply with quote

I just backed up and tested the restore of a ~300GB DB (mysql 5.1) using xtrabackup from this ebuild. Worked without a hitch.

Thanks!
Back to top
View user's profile Send private message
hydrapolic
Tux's lil' helper
Tux's lil' helper


Joined: 07 Feb 2008
Posts: 112

PostPosted: Fri Jun 14, 2013 2:43 pm    Post subject: Reply with quote

Added ebuild for 2.1.3 - support for MySQL 5.6 etc. However, since Percona removed support for MySQL 5.0/5.1 (innodb builtin), I've also added an ebuild for 2.0.7.

https://bugs.gentoo.org/show_bug.cgi?id=265407
https://github.com/hydrapolic/gentoo.git
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum