Views |
||||||||||||||
Backup & Recovery: Ch.22 MySQL Backup & Recovery
The MySQL LVM --snapshot backup bit (ch22; pg650) needs some more info, or a link to same. Having said that, I'm not sure what the link is. [1] got me going again, but it's not a HOWTO. [2] is a nice HOWTO, but it does not really address this issue IMHO... The problem is that LVM snapshots won't work unless you've planned for them and set up your filesystem correctly at install-time. It turns out that if your physical volume (PV) is full, probably because your logical volume(s) (LV) used the max size, there are "Insufficient free extents in volume group" to create a snapshot. [1] So when setting up the system, you have to deliberately leave enough free space in the PV or else you can't use snapshots... I was wondering how that would all work when reading that section of the book... I used resize2fs/lvresize on my test VM (gotta LOVE VMware) and all is now well. But I'm not sure I'd do that in production, and resize2fs requires that you unmount the volume if it's ext3, at least on the (pre-release) Debian Etch system I just tested. FWIW, there is a Perl script that takes care of performing LVM snapshot backups of MySQL automatically: mylvmbackup. From the project page: mylvmbackup is a Perl script for quickly creating backups of MySQL server's data files. To perform a backup, mylvmbackup obtains a read lock on all tables and flushes all server caches to disk, makes an LVM snapshot of the volume containing the MySQL data directory, and unlocks the tables again. The snapshot process takes only a small amount of time. When it is done, the server can continue normal operations, while the actual file backup proceeds. Footnotes: [1] http://mike.kruckenberg.com/archives/2006/05/mysql_backups_u.html See "just a note to anyone hoping to start using [LVM] snapshots on an already running system - even if the machine is already using [LVM], you're probably out of luck." [2] http://www.linux.org/docs/ldp/howto/LVM-HOWTO/index.html |
||||||||||||||
| This page was last modified 06:40, 30 July 2007. | ||||||||||||||