• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Advanced WAL File Management With OmniPITR
 

Advanced WAL File Management With OmniPITR

on

  • 1,990 views

Files from my talk on OmniPITR, delivered at PGEast 2011 in NYC

Files from my talk on OmniPITR, delivered at PGEast 2011 in NYC

Statistics

Views

Total Views
1,990
Views on SlideShare
1,989
Embed Views
1

Actions

Likes
1
Downloads
0
Comments
0

1 Embed 1

http://omniti.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Advanced WAL File Management With OmniPITR Advanced WAL File Management With OmniPITR Presentation Transcript

    • Advanced WAL File Management With OmniPITR Robert Treat, JDCon 2011 #pgeast / PresentationThursday, March 31, 2011
    • Who Am I? • Robert
Treat • OmniTI • Database
Management
and
Consulting • We’re
Hiring! • Postgres • Major
Contributor,
Web,
Advocacy,
Random • xzilla.net • @robtreat2Thursday, March 31, 2011
    • Who Am I? • Robert
Treat • OmniTI • Database
Management
and
Consulting • We’re
Hiring! • Postgres • Major
Contributor,
Web,
Advocacy,
Random • xzilla.net • @robtreat2Thursday, March 31, 2011
    • What is PITR?Thursday, March 31, 2011
    • What is PITR? •Postgres emits WAL filesThursday, March 31, 2011
    • DigressionThursday, March 31, 2011
    • Digression •WAL Logs? •Write Ahead Log Logs? •OTOH, they are stored in pg_xlog...Thursday, March 31, 2011
    • What is PITR?Thursday, March 31, 2011
    • What is PITR? •Postgres emits WAL filesThursday, March 31, 2011
    • What is PITR? •Postgres emits WAL files •Send the WAL file to another serverThursday, March 31, 2011
    • What is PITR? •Postgres emits WAL files •Send the WAL file to another server •The other server can replay the WALThursday, March 31, 2011
    • What is PITR? Use combination of data files and WAL to make more postgrezesThursday, March 31, 2011
    • What is PITR? •Postgres emits WAL files Use combination of data files and WAL to make more postgrezesThursday, March 31, 2011
    • What is PITR? •Postgres emits WAL files •Send the WAL file to another server Use combination of data files and WAL to make more postgrezesThursday, March 31, 2011
    • What is PITR? •Postgres emits WAL files •Send the WAL file to another server •The other server can replay the WAL Use combination of data files and WAL to make more postgrezesThursday, March 31, 2011
    • A Brief History of PITRThursday, March 31, 2011
    • A Brief History of PITR •8.1 (really)Thursday, March 31, 2011
    • A Brief History of PITR •8.1 (really) •8.2 (warm standby)Thursday, March 31, 2011
    • A Brief History of PITR •8.1 (really) •8.2 (warm standby) •9.0 (hot standby)Thursday, March 31, 2011
    • A Brief History of PITR •8.1 (really) •8.2 (warm standby) •9.0 (hot standby) •9.0 (streaming replication)Thursday, March 31, 2011
    • Ghetto Style archive_command = rsync %p sdb2:/data/pgsql/sdb1/84/walarchive/% fThursday, March 31, 2011
    • Ghetto Style •Simple, Better Than You’d Think archive_command = rsync %p sdb2:/data/pgsql/sdb1/84/walarchive/% fThursday, March 31, 2011
    • Early Version Of A PITR Script archive_command = ‘cp -i %p /data/pgsql/82_walarchives/%f </dev/null’Thursday, March 31, 2011
    • Early Version Of A PITR Script •Kind of Hacky archive_command = ‘cp -i %p /data/pgsql/82_walarchives/%f </dev/null’Thursday, March 31, 2011
    • Early Version Of A PITR Script archive_command = ‘cp -i %p /data/pgsql/82_walarchives/%f </dev/null’ opendir(DIR, "."); my @wals2move = grep { -f $_ && (stat(_))[9] + $AGE < time() && ( # 000000010000007200000031 ( /^[0-9A-F]{24}$/ && (stat(_))[7] == $WALSIZE ) || # 000000010000007200000031.0012C968.backup ( /^[0-9A-F]{24}.[0-9A-F]{8}.backup$/ ) ) && ( $mtime{$_} = (stat(_))[9] ) # Always true (for later) } readdir(DIR); closedir(DIR);Thursday, March 31, 2011
    • Early Version Of A PITR Script •Kind of Hacky archive_command = ‘cp -i %p /data/pgsql/82_walarchives/%f </dev/null’ opendir(DIR, "."); my @wals2move = grep { -f $_ && (stat(_))[9] + $AGE < time() && ( # 000000010000007200000031 ( /^[0-9A-F]{24}$/ && (stat(_))[7] == $WALSIZE ) || # 000000010000007200000031.0012C968.backup ( /^[0-9A-F]{24}.[0-9A-F]{8}.backup$/ ) ) && ( $mtime{$_} = (stat(_))[9] ) # Always true (for later) } readdir(DIR); closedir(DIR);Thursday, March 31, 2011
    • Early Version Of A PITR Script archive_command = ‘cp -i %p /data/pgsql/82_walarchives/%f </dev/null’ @wals2move = sort { $mtime{$a} <=> $mtime{$b} } @wals2move; if($TARGET) { foreach (@wals2move) { if($NOOP) { print "$RSYNC -essh --rsync-path=$REMOTE_RSYNC -a $_ $TARGET/$_n"; print "mv $_ $_.slavedn"; } else { if(system("$RSYNC -essh --rsync-path=$REMOTE_RSYNC -a $_ $TARGET/$_") != 0) { print STDERR "Error moving wal to target: $?n"; last; } if(!rename("$_", "$_.slaved")) { print STDERR "Error renaming $_ to $_.slavedn"; last; } } } }Thursday, March 31, 2011
    • Early Version Of A PITR Script •Kind of Hacky archive_command = ‘cp -i %p /data/pgsql/82_walarchives/%f </dev/null’ @wals2move = sort { $mtime{$a} <=> $mtime{$b} } @wals2move; if($TARGET) { foreach (@wals2move) { if($NOOP) { print "$RSYNC -essh --rsync-path=$REMOTE_RSYNC -a $_ $TARGET/$_n"; print "mv $_ $_.slavedn"; } else { if(system("$RSYNC -essh --rsync-path=$REMOTE_RSYNC -a $_ $TARGET/$_") != 0) { print STDERR "Error moving wal to target: $?n"; last; } if(!rename("$_", "$_.slaved")) { print STDERR "Error renaming $_ to $_.slavedn"; last; } } } }Thursday, March 31, 2011
    • CustomizationsThursday, March 31, 2011
    • Customizations •Multiple DestinationsThursday, March 31, 2011
    • Customizations •Multiple Destinations •WAL File DelayThursday, March 31, 2011
    • Customizations •Multiple Destinations •WAL File Delay •Archive Storage (gzip & friends)Thursday, March 31, 2011
    • Customizations •Multiple Destinations •WAL File Delay •Archive Storage (gzip & friends) •Better BackupsThursday, March 31, 2011
    • ENTER: OmniPITRThursday, March 31, 2011
    • ENTER: OmniPITR •Consolidate various scriptsThursday, March 31, 2011
    • ENTER: OmniPITR •Consolidate various scripts •Deploy across ‘NixesThursday, March 31, 2011
    • ENTER: OmniPITR •Consolidate various scripts •Deploy across ‘Nixes •ReusableThursday, March 31, 2011
    • ENTER: OmniPITR •Consolidate various scripts •Deploy across ‘Nixes •Reusable •Complete SolutionThursday, March 31, 2011
    • OmniPITR-ArchiveThursday, March 31, 2011
    • OmniPITR-Archive •Lots of optionsThursday, March 31, 2011
    • OmniPITR-Archive •Lots of options •compressionThursday, March 31, 2011
    • OmniPITR-Archive •Lots of options •compression •custom log fileThursday, March 31, 2011
    • OmniPITR-Archive •Lots of options •compression •custom log file •special pathsThursday, March 31, 2011
    • OmniPITR-Archive •Lots of options •compression •custom log file •special paths •multiple destinationsThursday, March 31, 2011
    • OmniPITR-Archive Example archive_command = /opt/OMNIpitr/bin/omnipitr-archive -l "/var/log/omnipitr/omnipitr-^Y-^m-^d.log" -s /var/lib/pgsql/omnipitr/state/ -t /var/tmp/ -dr gzip=db4:/mnt/db/prod/walarchive/ -dr db4:/mnt/db/prod/db4-walarchive/ -db /var/lib/pgsql/omnipitr/backup.xlogs "%p"Thursday, March 31, 2011
    • OmniPITR-Archive Example archive_command = /opt/OMNIpitr/bin/omnipitr-archive -l "/var/log/omnipitr/omnipitr-^Y-^m-^d.log" -s /var/lib/pgsql/omnipitr/state/ -t /var/tmp/ -dr gzip=db4:/mnt/db/prod/walarchive/ -dr db4:/mnt/db/prod/db4-walarchive/ -db /var/lib/pgsql/omnipitr/backup.xlogs "%p" Location of OmniPITRThursday, March 31, 2011
    • OmniPITR-Archive Example archive_command = /opt/OMNIpitr/bin/omnipitr-archive -l "/var/log/omnipitr/omnipitr-^Y-^m-^d.log" -s /var/lib/pgsql/omnipitr/state/ -t /var/tmp/ -dr gzip=db4:/mnt/db/prod/walarchive/ -dr db4:/mnt/db/prod/db4-walarchive/ -db /var/lib/pgsql/omnipitr/backup.xlogs "%p" Custom Log File Name/LocationThursday, March 31, 2011
    • OmniPITR-Archive Example archive_command = /opt/OMNIpitr/bin/omnipitr-archive -l "/var/log/omnipitr/omnipitr-^Y-^m-^d.log" -s /var/lib/pgsql/omnipitr/state/ -t /var/tmp/ -dr gzip=db4:/mnt/db/prod/walarchive/ -dr db4:/mnt/db/prod/db4-walarchive/ -db /var/lib/pgsql/omnipitr/backup.xlogs "%p" state-directory to handle errors when sending wal to multiple destinationsThursday, March 31, 2011
    • OmniPITR-Archive Example archive_command = /opt/OMNIpitr/bin/omnipitr-archive -l "/var/log/omnipitr/omnipitr-^Y-^m-^d.log" -s /var/lib/pgsql/omnipitr/state/ -t /var/tmp/ -dr gzip=db4:/mnt/db/prod/walarchive/ -dr db4:/mnt/db/prod/db4-walarchive/ -db /var/lib/pgsql/omnipitr/backup.xlogs "%p" Where To Create Temp FilesThursday, March 31, 2011
    • OmniPITR-Archive Example archive_command = /opt/OMNIpitr/bin/omnipitr-archive -l "/var/log/omnipitr/omnipitr-^Y-^m-^d.log" -s /var/lib/pgsql/omnipitr/state/ -t /var/tmp/ -dr gzip=dbx:/mnt/db/prod/walstorage/ -dr db4:/mnt/db/prod/db4-walarchive/ -db /var/lib/pgsql/omnipitr/backup.xlogs "%p" send to remote server (dbx) compressed (gzip)Thursday, March 31, 2011
    • OmniPITR-Archive Example archive_command = /opt/OMNIpitr/bin/omnipitr-archive -l "/var/log/omnipitr/omnipitr-^Y-^m-^d.log" -s /var/lib/pgsql/omnipitr/state/ -t /var/tmp/ -dr gzip=db4:/mnt/db/prod/walarchive/ -dr db4:/mnt/db/prod/db4-walarchive/ -db /var/lib/pgsql/omnipitr/backup.xlogs "%p" send to remote server (db4) uncompressedThursday, March 31, 2011
    • OmniPITR-Archive Example archive_command = /opt/OMNIpitr/bin/omnipitr-archive -l "/var/log/omnipitr/omnipitr-^Y-^m-^d.log" -s /var/lib/pgsql/omnipitr/state/ -t /var/tmp/ -dr gzip=db4:/mnt/db/prod/walarchive/ -dr db4:/mnt/db/prod/db4-walarchive/ -db /var/lib/pgsql/omnipitr/backup.xlogs "%p" Where to store xlogs when building a backupThursday, March 31, 2011
    • OmniPITR-Archive Example archive_command = /opt/OMNIpitr/bin/omnipitr-archive -l "/var/log/omnipitr/omnipitr-^Y-^m-^d.log" -s /var/lib/pgsql/omnipitr/state/ -t /var/tmp/ -dr gzip=db4:/mnt/db/prod/walarchive/ -dr db4:/mnt/db/prod/db4-walarchive/ -db /var/lib/pgsql/omnipitr/backup.xlogs "%p" The xlog file :-)Thursday, March 31, 2011
    • OmniPITR-RestoreThursday, March 31, 2011
    • OmniPITR-Restore •Lots of options (though not as many)Thursday, March 31, 2011
    • OmniPITR-Restore •Lots of options (though not as many) •compressed files?Thursday, March 31, 2011
    • OmniPITR-Restore •Lots of options (though not as many) •compressed files? •custom log fileThursday, March 31, 2011
    • OmniPITR-Restore •Lots of options (though not as many) •compressed files? •custom log file •special pathsThursday, March 31, 2011
    • OmniPITR-Restore Example restore_command = /opt/OMNIpitr/bin/omnipitr-restore -l /var/lib/pgsql/data/pg_log/omnipitr-^Y-^m-^d.log -s /var/lib/pgsql/wal_archive/ -p /var/lib/pgsql/wal_archives.pause -v -r %f %p location of omnipitr-restore programThursday, March 31, 2011
    • OmniPITR-Restore Example restore_command = /opt/OMNIpitr/bin/omnipitr-restore -l /var/lib/pgsql/data/pg_log/omnipitr-^Y-^m-^d.log -s /var/lib/pgsql/wal_archive/ -p /var/lib/pgsql/wal_archives.pause -v -r %f %p custom log file formatThursday, March 31, 2011
    • OmniPITR-Restore Example restore_command = /opt/OMNIpitr/bin/omnipitr-restore -l /var/lib/pgsql/data/pg_log/omnipitr-^Y-^m-^d.log -s /var/lib/pgsql/wal_archive/ -p /var/lib/pgsql/wal_archives.pause -v -r %f %p Source of WAL Files to Use For RestoreThursday, March 31, 2011
    • OmniPITR-Restore Example restore_command = /opt/OMNIpitr/bin/omnipitr-restore -l /var/lib/pgsql/data/pg_log/omnipitr-^Y-^m-^d.log -s /var/lib/pgsql/wal_archive/ -p /var/lib/pgsql/wal_archives.pause -v -r %f %p pause xlog removal if this file exists (foreshadow: used for making backups)Thursday, March 31, 2011
    • OmniPITR-Restore Example restore_command = /opt/OMNIpitr/bin/omnipitr-restore -l /var/lib/pgsql/data/pg_log/omnipitr-^Y-^m-^d.log -s /var/lib/pgsql/wal_archive/ -p /var/lib/pgsql/wal_archives.pause -v -r %f %p verboseThursday, March 31, 2011
    • OmniPITR-Restore Example restore_command = /opt/OMNIpitr/bin/omnipitr-restore -l /var/lib/pgsql/data/pg_log/omnipitr-^Y-^m-^d.log -s /var/lib/pgsql/wal_archive/ -p /var/lib/pgsql/wal_archives.pause -v -r %f %p Remove Xlogs Files Which Are No Longer NeededThursday, March 31, 2011
    • OmniPITR-Restore Example restore_command = /opt/OMNIpitr/bin/omnipitr-restore -l /var/lib/pgsql/data/pg_log/omnipitr-^Y-^m-^d.log -s /var/lib/pgsql/wal_archive/ -p /var/lib/pgsql/wal_archives.pause -v -r %f %p standard macros for “basename of segment” and “destination of recovery”Thursday, March 31, 2011
    • OmniPITR-Master-BackupThursday, March 31, 2011
    • OmniPITR-Master-Backup •GoalThursday, March 31, 2011
    • OmniPITR-Master-Backup •Goal •simple “tarball” for backupThursday, March 31, 2011
    • OmniPITR-Master-Backup •Goal •simple “tarball” for backup •one for $PGDATA and xlogsThursday, March 31, 2011
    • OmniPITR-Master-Backup •Goal •simple “tarball” for backup •one for $PGDATA and xlogs •simple to blow open and useThursday, March 31, 2011
    • OmniPITR-Master-Backup Example /opt/OMNIpitr/bin/omnipitr-backup-master -v -l "/var/log/omnipitr/omnipitr-^Y-^m-^d.log" -x /var/lib/pgsql/omnipitr/backup.xlogs -dr gzip=db4:/mnt/db/prod/backups/ -t /var/tmp/ -pp /usr/pgsql-9.0/bin/psql -D /pg_data/90data location of OmniPITR-backup-masterThursday, March 31, 2011
    • OmniPITR-Master-Backup Example /opt/OMNIpitr/bin/omnipitr-backup-master -v -l "/var/log/omnipitr/omnipitr-^Y-^m-^d.log" -x /var/lib/pgsql/omnipitr/backup.xlogs -dr gzip=db4:/mnt/db/prod/backups/ -t /var/tmp/ -pp /usr/pgsql-9.0/bin/psql -D /pg_data/90data verboseThursday, March 31, 2011
    • OmniPITR-Master-Backup Example /opt/OMNIpitr/bin/omnipitr-backup-master -v -l "/var/log/omnipitr/omnipitr-^Y-^m-^d.log" -x /var/lib/pgsql/omnipitr/backup.xlogs -dr gzip=db4:/mnt/db/prod/backups/ -t /var/tmp/ -pp /usr/pgsql-9.0/bin/psql -D /pg_data/90data custom log fileThursday, March 31, 2011
    • OmniPITR-Master-Backup Example /opt/OMNIpitr/bin/omnipitr-backup-master -v -l "/var/log/omnipitr/omnipitr-^Y-^m-^d.log" -x /var/lib/pgsql/omnipitr/backup.xlogs -dr gzip=db4:/mnt/db/prod/backups/ -t /var/tmp/ -pp /usr/pgsql-9.0/bin/psql -D /pg_data/90data directory to store xlogs during backup creationThursday, March 31, 2011
    • OmniPITR-Master-Backup Example /opt/OMNIpitr/bin/omnipitr-backup-master -v -l "/var/log/omnipitr/omnipitr-^Y-^m-^d.log" -x /var/lib/pgsql/omnipitr/backup.xlogs -dr gzip=db4:/mnt/db/prod/backups/ -t /var/tmp/ -pp /usr/pgsql-9.0/bin/psql -D /pg_data/90data copy backup file to remote server, compressedThursday, March 31, 2011
    • OmniPITR-Master-Backup Example /opt/OMNIpitr/bin/omnipitr-backup-master -v -l "/var/log/omnipitr/omnipitr-^Y-^m-^d.log" -x /var/lib/pgsql/omnipitr/backup.xlogs -dr gzip=db4:/mnt/db/prod/backups/ -t /var/tmp/ -pp /usr/pgsql-9.0/bin/psql -D /pg_data/90data location for temporary files whilst workingThursday, March 31, 2011
    • OmniPITR-Master-Backup Example /opt/OMNIpitr/bin/omnipitr-backup-master -v -l "/var/log/omnipitr/omnipitr-^Y-^m-^d.log" -x /var/lib/pgsql/omnipitr/backup.xlogs -dr gzip=db4:/mnt/db/prod/backups/ -t /var/tmp/ -pp /usr/pgsql-9.0/bin/psql -D /pg_data/90data path to psqlThursday, March 31, 2011
    • OmniPITR-Master-Backup Example /opt/OMNIpitr/bin/omnipitr-backup-master -v -l "/var/log/omnipitr/omnipitr-^Y-^m-^d.log" -x /var/lib/pgsql/omnipitr/backup.xlogs -dr gzip=db4:/mnt/db/prod/backups/ -t /var/tmp/ -pp /usr/pgsql-9.0/bin/psql -D /pg_data/90data $PGDATAThursday, March 31, 2011
    • Programmers Say: “I love it when people use my software to do cool things that I didn’t expect”Thursday, March 31, 2011
    • Treat’s Maxim? “Try not to let the way software was designed get in the way of how you want to use it”Thursday, March 31, 2011
    • OmniPITR-Slave-BackupThursday, March 31, 2011
    • OmniPITR-Slave-Backup •On MySQL, you could dump on slave for a long timeThursday, March 31, 2011
    • OmniPITR-Slave-Backup •On MySQL, you could dump on slave for a long time •On ZFS, we use snapshots to make slaves on the backupsThursday, March 31, 2011
    • OmniPITR-Slave-Backup •On MySQL, you could dump on slave for a long time •On ZFS, we use snapshots to make slaves on the backups •While “we” prefer to use Postgres, some of us prefer to use LinuxThursday, March 31, 2011
    • OmniPITR-Slave-Backup •On MySQL, you could dump on slave for a long time •On ZFS, we use snapshots to make slaves on the backups •While “we” prefer to use Postgres, some of us prefer to use Linux •But, you still don’t want to pay the price for backups on masterThursday, March 31, 2011
    • OmniPITR-Slave-Backup Example /opt/OMNIpitr/bin/omnipitr-backup-slave -v -l "/var/log/omnipitr/omnipitr-slave-backup-^Y-^m-^d.log" -s /mnt/db/prod/db4-walarchive -p /var/lib/pgsql/omnipitr/pause.removal -D /pg_data/90data/ -t /var/tmp/ -gp /usr/bin/pigz -dl gzip=/mnt/db/prod/backups/ -pp /usr/pgsql-9.0/bin/pg_controldata Location of omni-pitr-slave commandThursday, March 31, 2011
    • OmniPITR-Slave-Backup Example /opt/OMNIpitr/bin/omnipitr-backup-slave -v -l "/var/log/omnipitr/omnipitr-slave-backup-^Y-^m-^d.log" -s /mnt/db/prod/db4-walarchive -p /var/lib/pgsql/omnipitr/pause.removal -D /pg_data/90data/ -t /var/tmp/ -gp /usr/bin/pigz -dl gzip=/mnt/db/prod/backups/ -pp /usr/pgsql-9.0/bin/pg_controldata verboseThursday, March 31, 2011
    • OmniPITR-Slave-Backup Example /opt/OMNIpitr/bin/omnipitr-backup-slave -v -l "/var/log/omnipitr/omnipitr-slave-backup-^Y-^m-^d.log" -s /mnt/db/prod/db4-walarchive -p /var/lib/pgsql/omnipitr/pause.removal -D /pg_data/90data/ -t /var/tmp/ -gp /usr/bin/pigz -dl gzip=/mnt/db/prod/backups/ -pp /usr/pgsql-9.0/bin/pg_controldata custom log location / formatThursday, March 31, 2011
    • OmniPITR-Slave-Backup Example /opt/OMNIpitr/bin/omnipitr-backup-slave -v -l "/var/log/omnipitr/omnipitr-slave-backup-^Y-^m-^d.log" -s /mnt/db/prod/db4-walarchive -p /var/lib/pgsql/omnipitr/pause.removal -D /pg_data/90data/ -t /var/tmp/ -gp /usr/bin/pigz -dl gzip=/mnt/db/prod/backups/ -pp /usr/pgsql-9.0/bin/pg_controldata source of wal filesThursday, March 31, 2011
    • OmniPITR-Slave-Backup Example /opt/OMNIpitr/bin/omnipitr-backup-slave -v -l "/var/log/omnipitr/omnipitr-slave-backup-^Y-^m-^d.log" -s /mnt/db/prod/db4-walarchive -p /var/lib/pgsql/omnipitr/pause.removal -D /pg_data/90data/ -t /var/tmp/ -gp /usr/bin/pigz -dl gzip=/mnt/db/prod/backups/ -pp /usr/pgsql-9.0/bin/pg_controldata file to pause removal of xlogs no longer needed for restore but still needed by backupThursday, March 31, 2011
    • OmniPITR-Slave-Backup Example /opt/OMNIpitr/bin/omnipitr-backup-slave -v -l "/var/log/omnipitr/omnipitr-slave-backup-^Y-^m-^d.log" -s /mnt/db/prod/db4-walarchive -p /var/lib/pgsql/omnipitr/pause.removal -D /pg_data/90data/ -t /var/tmp/ -gp /usr/bin/pigz -dl gzip=/mnt/db/prod/backups/ -pp /usr/pgsql-9.0/bin/pg_controldata $PGDATAThursday, March 31, 2011
    • OmniPITR-Slave-Backup Example /opt/OMNIpitr/bin/omnipitr-backup-slave -v -l "/var/log/omnipitr/omnipitr-slave-backup-^Y-^m-^d.log" -s /mnt/db/prod/db4-walarchive -p /var/lib/pgsql/omnipitr/pause.removal -D /pg_data/90data/ -t /var/tmp/ -gp /usr/bin/pigz -dl gzip=/mnt/db/prod/backups/ -pp /usr/pgsql-9.0/bin/pg_controldata location for temp files whilst workingThursday, March 31, 2011
    • OmniPITR-Slave-Backup Example /opt/OMNIpitr/bin/omnipitr-backup-slave -v -l "/var/log/omnipitr/omnipitr-slave-backup-^Y-^m-^d.log" -s /mnt/db/prod/db4-walarchive -p /var/lib/pgsql/omnipitr/pause.removal -D /pg_data/90data/ -t /var/tmp/ -gp /usr/bin/pigz -dl gzip=/mnt/db/prod/backups/ -pp /usr/pgsql-9.0/bin/pg_controldata location of our “gzip”Thursday, March 31, 2011
    • OmniPITR-Slave-Backup Example /opt/OMNIpitr/bin/omnipitr-backup-slave -v -l "/var/log/omnipitr/omnipitr-slave-backup-^Y-^m-^d.log" -s /mnt/db/prod/db4-walarchive -p /var/lib/pgsql/omnipitr/pause.removal -D /pg_data/90data/ -t /var/tmp/ -gp /usr/bin/pigz -dl gzip=/mnt/db/prod/backups/ -pp /usr/pgsql-9.0/bin/pg_controldata local storage, compressedThursday, March 31, 2011
    • OmniPITR-Slave-Backup Example /opt/OMNIpitr/bin/omnipitr-backup-slave -v -l "/var/log/omnipitr/omnipitr-slave-backup-^Y-^m-^d.log" -s /mnt/db/prod/db4-walarchive -p /var/lib/pgsql/omnipitr/pause.removal -D /pg_data/90data/ -t /var/tmp/ -gp /usr/bin/pigz -dl gzip=/mnt/db/prod/backups/ -pp /usr/pgsql-9.0/bin/pg_controldata path to pg_controldataThursday, March 31, 2011
    • Production Use?Thursday, March 31, 2011
    • Production Use? •Versions 8.2, 8.3, 8.4, 9.0Thursday, March 31, 2011
    • Production Use? •Versions 8.2, 8.3, 8.4, 9.0 •Linux, SolarisThursday, March 31, 2011
    • Production Use? •Versions 8.2, 8.3, 8.4, 9.0 •Linux, Solaris •TB+ Databases, with multiple tablespacesThursday, March 31, 2011
    • Production Use? •Versions 8.2, 8.3, 8.4, 9.0 •Linux, Solaris •TB+ Databases, with multiple tablespaces •Thousands of txn/secThursday, March 31, 2011
    • Production Use? •Versions 8.2, 8.3, 8.4, 9.0 •Linux, Solaris •TB+ Databases, with multiple tablespaces •Thousands of txn/sec •Cross DatacenterThursday, March 31, 2011
    • Where’s The Code? https://labs.omniti.com/labs/pgtreats svn co https://labs.omniti.com/pgtreats/trunk/omnipitr/Thursday, March 31, 2011
    • Where’s The Code? •Currently in “PGTreats” Repo https://labs.omniti.com/labs/pgtreats svn co https://labs.omniti.com/pgtreats/trunk/omnipitr/Thursday, March 31, 2011
    • Where’s The Code? •Currently in “PGTreats” Repo •Available Via SVN Pull https://labs.omniti.com/labs/pgtreats svn co https://labs.omniti.com/pgtreats/trunk/omnipitr/Thursday, March 31, 2011
    • Where’s The Code? •Currently in “PGTreats” Repo •Available Via SVN Pull •“BSD” Licensed https://labs.omniti.com/labs/pgtreats svn co https://labs.omniti.com/pgtreats/trunk/omnipitr/Thursday, March 31, 2011
    • TODOThursday, March 31, 2011
    • TODO •Better MonitoringThursday, March 31, 2011
    • TODO •Better Monitoring •Parallel Multi-DestinationThursday, March 31, 2011
    • TODO •Better Monitoring •Parallel Multi-Destination •Multiple-Source RestoresThursday, March 31, 2011
    • BUGS Failover of a streaming replication based slave created from a slave based backup file against a stream replication based slave doesn’t workThursday, March 31, 2011
    • BUGS Failover of a streaming replication based slave created from a slave based backup file against a stream replication based slave doesn’t work, sometimes,Thursday, March 31, 2011
    • BUGS Failover of a streaming replication based slave created from a slave based backup file against a stream replication based slave doesn’t work, sometimes, when under loadThursday, March 31, 2011
    • BUGS Failover of a streaming replication based slave created from a slave based backup file against a stream replication based slave doesn’t work, sometimes, when under load We think it’s a flaw in Postgres, but hard to say for sureThursday, March 31, 2011
    • THE END Thanks! pgeast, pgus Slides http://www.xzilla.net/Thursday, March 31, 2011