Introducing Xtrabackup Manager

Post on 24-May-2015

1.819 views 2 download

Tags:

Transcript of Introducing Xtrabackup Manager

Introducing XtraBackup Manager

as told by Henrik Ingo, Percona Live UK 2012

[joe@bup01 /backup/udb] ls -laFh

-rw-rw-r-- 1 xbm xbm 20 Feb 01 2012 userdb-2012-02-01.gz

[joe@bup01 /backup/udb]

[joe@bup01 /backup/udb] zcat userdb-2012-02-01.gz

[joe@bup01 /backup/udb]

#!/bin/bashmysqldump -u web --password=j03r0cks! \-h userdb.corp.com users | gzip > $BACKUPFILEif [ $? -ne 0 ]; then backupalert.sh "ALERT: Failure while backing up userdb!!"else writelog.sh "User DB Backup Complete!"fi

#!/bin/bashmysqldump -u web --password=j03r0cks! \-h userdb.corp.com users | gzip > $BACKUPFILEif [ $? -ne 0 ]; then backupalert.sh "ALERT: Failure while backing up userdb!!"else writelog.sh "User DB Backup Complete!"fi

A few little facts...

•XBM for short (cmd line tool)

•Written in PHP5 (Object Oriented)

•Leverages cron, netcat and ssh

•Works on Linux and Solaris

•GPLv2

So how does it work?...

QuickStart Guide

http://code.google.com/p/xtrabackup-manager/wiki/QuickStartGuide

What you’ll need...

•Server with plenty of storage space (management server)

– MySQL 5.x+

– PHP 5.1.6+ (CLI)

•mysql or root access to the servers

•XtraBackup 1.6.4+

Installing...•Create UNIX user for XBM

•Create MySQL user for XBM + Schema

•Download latest tarball

•Extract to xbm user homedir

•Initialize the XBM schema:

mysql xbm < ./sql/schema_init.sql

Setup SSH Trust...

XBM user must be able to SSH without password:

shell> ssh mysql@dbhost

Install XtraBackup...

• Download & Install XtraBackup 1.6.4+

• Install on both backup server and DB hosts

• Ensure XtraBackup is in $PATH too

./xbm

./xbm backup list

./xbm volume add "mybackupdir" /home/xbm/backups/

./xbm volume list

./xbm host add localhost Just-testing

./xbm host list

./xbm backup add localhost monthlyBackup FULLONLY "30 03 01 * *" mybackupdir /var/lib/mysql root root./xbm backup list./xbm backup run localhost monthlyBackup./xbm snapshot list localhostls ../backups/ls ../backups/localhostls ../backups/localhost/*

Backup Strategies?

•When do I take full backups?

•When should I take incremental backups?

•How many snapshots do I keep?

•... etc.

Backup Strategies!

•Full Only

•Continuous Incrementals

•Rotating Sets of Incrementals

How about time to restore?

Enter Materialized Backups...

Materialized backups mean less

waiting...

Other neat features?...

•Throttling

•Email Alerts

•Rich logging

•Immediate Apply Logs

•Did I mention 100% open source

What is it missing?

What is missing?

•1.0 release

•pitr (copy binlogs)

•compression

•encryption

•progress indicator

•GUI

Meh... Any alternatives?

•Zmanda Recovery Manager (ZRM)

•Used to be open source in 2006

•Still there, does support xtrabackup (and everything else)

•GUI, a bell and 3 whistles included!

Try it out!

Google Code:

http://code.google.com/p/xtrabackup-manager

MySQL Soapbox - (My Blog)

http://mysqlsoapbox.blogspot.com

Thank you!