On 18/05/11 12:30, Tim Small wrote: > > We use a hacked version of mylvmbackup to backup an entire container. > Each container lives on its own logical volume, and the process calls > into the logical volume to ask the database (mysql in this case) to make > its data-on-disk consistent. At this point, and LVM snapshot is taken, > then mysql is told it can carry on writing to disk. The LVM snapshot is > then fscked and mounted on a different mountpoint, once mounted, the > contents are rsynced to the standby machine, and the lvm snapshot is > removed. >
I should add that this is done at a relatively quiet time on the server (if it's a server with lots of writes), as it has the side effect of turning a single write on the containers storage into two writes and a read (plus associated disk seeks) whilst the LVM snapshot exists. Whilst the lvm snapshot is being created (< 1 second), writes to the database block (reads continue as normal, however), then continue once mysql gets the UNLOCK TABLES command. I don't know if there is equivalent functionality available in other databases such as PostgreSQL etc. Cheers, Tim. -- South East Open Source Solutions Limited Registered in England and Wales with company number 06134732. Registered Office: 2 Powell Gardens, Redhill, Surrey, RH1 1TQ VAT number: 900 6633 53 http://seoss.co.uk/ +44-(0)1273-808309 _______________________________________________ Users mailing list Users@openvz.org https://openvz.org/mailman/listinfo/users