mysql backup quesiton
Matthew Gillen
me at mattgillen.net
Thu Jan 3 10:00:00 EST 2008
Matt Shields wrote:
> On Jan 3, 2008 9:43 AM, Matthew Gillen <me at mattgillen.net> wrote:
>>> Can't you just use rsync on the MySQL data directories to create a mirror?
>>
>> Only if you shut down the server first, to guarantee that you're not in the
>> middle of operation that would leave the on-disk database in an inconsistent
>> state (and thus unusable as a backup).
>
> Yes you can. Do a flush tables, then do a LVM snapshot. You can then
> copy the files. Once the file copy is done, release the snapshot. I
> use this method to refresh my replicated slaves if something gets
> corrupted on them. Master db stays online the whole time.
And this works since the LVM snapshot operation is instantaneous? Interesting
technique.
It seems like theoretically you could still get in trouble, but unless your
server is extremely busy with update operations, it seems highly unlikely that
the split second between the flush and snapshot operations would see an
attempt by MySQL to update the on-disk representation.
Am I wrong?
Matt
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the Discuss
mailing list