Introducing Xtrabackup Manager

49
Introducing XtraBackup Manager as told by Henrik Ingo, Percona Live UK 2012

Transcript of Introducing Xtrabackup Manager

Page 1: Introducing Xtrabackup Manager

Introducing XtraBackup Manager

as told by Henrik Ingo, Percona Live UK 2012

Page 2: Introducing Xtrabackup Manager
Page 3: Introducing Xtrabackup Manager
Page 4: Introducing Xtrabackup Manager
Page 5: Introducing Xtrabackup Manager
Page 6: Introducing Xtrabackup Manager
Page 7: Introducing Xtrabackup Manager
Page 8: Introducing Xtrabackup Manager
Page 9: Introducing Xtrabackup Manager
Page 10: Introducing Xtrabackup Manager

[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]

Page 11: Introducing Xtrabackup Manager
Page 12: Introducing Xtrabackup Manager

#!/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

Page 13: Introducing Xtrabackup Manager

#!/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

Page 14: Introducing Xtrabackup Manager
Page 15: Introducing Xtrabackup Manager
Page 16: Introducing Xtrabackup Manager
Page 17: Introducing Xtrabackup Manager
Page 18: Introducing Xtrabackup Manager
Page 19: Introducing Xtrabackup Manager
Page 20: Introducing Xtrabackup Manager
Page 21: Introducing Xtrabackup Manager
Page 22: Introducing Xtrabackup Manager

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

Page 23: Introducing Xtrabackup Manager

So how does it work?...

Page 24: Introducing Xtrabackup Manager

QuickStart Guide

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

Page 25: Introducing Xtrabackup Manager

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+

Page 26: Introducing Xtrabackup Manager

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

Page 27: Introducing Xtrabackup Manager

Setup SSH Trust...

XBM user must be able to SSH without password:

shell> ssh mysql@dbhost

Page 28: Introducing Xtrabackup Manager

Install XtraBackup...

• Download & Install XtraBackup 1.6.4+

• Install on both backup server and DB hosts

• Ensure XtraBackup is in $PATH too

Page 29: Introducing Xtrabackup Manager
Page 30: Introducing Xtrabackup Manager

./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/*

Page 31: Introducing Xtrabackup Manager
Page 32: Introducing Xtrabackup Manager

Backup Strategies?

•When do I take full backups?

•When should I take incremental backups?

•How many snapshots do I keep?

•... etc.

Page 33: Introducing Xtrabackup Manager

Backup Strategies!

•Full Only

•Continuous Incrementals

•Rotating Sets of Incrementals

Page 34: Introducing Xtrabackup Manager
Page 35: Introducing Xtrabackup Manager
Page 36: Introducing Xtrabackup Manager
Page 37: Introducing Xtrabackup Manager
Page 38: Introducing Xtrabackup Manager
Page 39: Introducing Xtrabackup Manager
Page 40: Introducing Xtrabackup Manager

How about time to restore?

Page 41: Introducing Xtrabackup Manager

Enter Materialized Backups...

Page 42: Introducing Xtrabackup Manager

Materialized backups mean less

waiting...

Page 43: Introducing Xtrabackup Manager
Page 44: Introducing Xtrabackup Manager

Other neat features?...

•Throttling

•Email Alerts

•Rich logging

•Immediate Apply Logs

•Did I mention 100% open source

Page 45: Introducing Xtrabackup Manager

What is it missing?

Page 46: Introducing Xtrabackup Manager

What is missing?

•1.0 release

•pitr (copy binlogs)

•compression

•encryption

•progress indicator

•GUI

Page 47: Introducing Xtrabackup Manager

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!

Page 48: Introducing Xtrabackup Manager

Try it out!

Google Code:

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

MySQL Soapbox - (My Blog)

http://mysqlsoapbox.blogspot.com

Page 49: Introducing Xtrabackup Manager

Thank you!