Vadim,
I think I have successfully set up our backup/restore plan. I'm
including the details here so you'll know ways that people are using
your software, and as a reference in case other people are thinking
about a similar strategy.
Background:
- We have a CentOS 5.2 x86_64 server
- We are running MySql version 5.0.67-community (no replication or any
other complexities) with the majority of the tables being InnoDB (the
only ones that are not InnoDB are the system tables created by our
operating system, apache, mail, etc.).
- We need to do hot backups (or at least semi-hot) instead of using
mysqldump so that we have less read-lock time, and so that recovery
will be faster in case of a crash
- We would still like the convenience (and piece-of-mind) of having
full sql/logical backups in case we ever need them (but we want to do
these backups on a different server)
- We have enabled the binlog on our server
- We are using innodb file per table
- We want to store our backups on our remote Rackspace Cloud Files
space using JungleDisk
Our Approach:
Raw Backups using innobackupex:
- I created a shell script that runs innobackupex to back up our
entire mysql server. The script does the following:
- Delete any previous backups in the backup directory that are over
5 days old
- Back up server using innobackupex
- Parse the innobackupex output to find out the name of the backup
folder that was created
- Gzip the backup folder
- Transfer the gzip file using JungleDisk to our remote Rackspace
Cloud Files space
- The shell script is run every 6 hours using cron
Sql/Logical backups using mysqldump on a separate server:
- I have an iMac with Parallels 4.0. I installed a CentOS 5.3 x86_64
virtual machine and it is running MySql 5.0.45-community.
- I created a shell script that does the following inside the CentOS
VM:
- SSH into our dedicated server and find the latest updated .tar.gz
file in the backups directory
- Copy that file to the CentOS VM and untar
- Stop mysqld
- Delete all data from the /var/lib/mysql directory
- Use innobackupex --apply-logs to prepare the files
- Use innobackupex --copy-back to move the files into /var/lib/
mysql
- Start mysqld
- Run mysqldump to dump the databases into a gzip file
- Copy that dump file back to the dedicated server
- The script is run each night using cron
- I have another shell script on my Mac that starts the CentOS VM 5
minutes before the mysqldump script it scheduled to run on the VM, and
then it suspends the VM 30 minutes later
It took me a while, but I finally have this all up and running.
Thanks for your great backup software!
Blake