[Gllug] MySQL Bashing - was very very cheap hosting

James Bromberger james at rcpt.to
Sun Aug 22 22:33:45 UTC 2004


On 22 Aug 2004, at 12:30, Martin A. Brooks wrote:
> Ian Norton wrote:
>> Honestly, Ive been using mysql for about 3 years, it is fast, 
>> reliable, quick
>> to install and easy to backup. Once more it is GPL.
> Until it got ACID compliant transactions, it wasn't possible to back 
> up the database while it was online unless you obtained a lock on 
> every table.  Even now on mixed table type databases there are still 
> race conditions where you could end up with an inconsistent data.
>

Use LVM and 2.6.8.1 kernel with new snapshot goodness (see the 
changelog). Mount your MySQL on an LVM Logical Partition. In one 
thread, start a connection to MySQL and issue the command 'flush tables 
with read lock', in a second window do a 'lvcreate -s -L 10M -n 
backup_lv /dev/my_vg/my_lv' which will take an instant to complete, 
then in the first window do 'unlock tables', then mount your snapshot, 
and tar away...

You should test this thoroughly before you rely on it. And you should 
have MySQL slaves that you perform this backup on that are running with 
the 'read-only' option. You should also monitor your slave(s) to ensure 
they are up to date with your master.... I have scripts for monitoring 
this if people would like to see...

   JEB

-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list