View previous topic :: View next topic |
Author |
Message |
hydrapolic Tux's lil' helper
Joined: 07 Feb 2008 Posts: 126
|
Posted: Wed Aug 01, 2012 2:48 pm Post subject: MySQL hot backup with Percona XtraBackup |
|
|
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 |
|
|
zeek Guru
Joined: 16 Nov 2002 Posts: 480 Location: Bantayan Island
|
Posted: Wed Aug 08, 2012 9:14 pm Post subject: |
|
|
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 |
|
|
hydrapolic Tux's lil' helper
Joined: 07 Feb 2008 Posts: 126
|
|
Back to top |
|
|
|
|
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
|
|