[DRBD-user] Use DRBD and LVM Snapshots to create a point-in-time replica

Lars Ellenberg Lars.Ellenberg at linbit.com
Thu Jan 11 14:21:50 CET 2007

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


/ 2007-01-11 12:29:11 +0100
\ Ralf Schenk:
> Ross S. W. Walker schrieb:
> > As the subject says I want to know if it is possible to use DRBD and LVM
> > snapshots to create a point-in-time replica?
> > 
> > This would allow me to rotate snapshots in a pattern that would provide
> > the best consistency/coverage for my needs.
> > 
> 
> Hello !
> 
> I do this on a server pair with DRBD 8.0pre6 under XEN. I think you will
> have to use DRBD 8.X because only later DRBD Versions claim to run
> without problems on top of LVM Volumes.

drbd 0.7 is also fine on top of lvm
(thats our typical setup: md - lvm - drbd)
or below lvm (as pv)
or even (if you really want to have a headache) in some weird
lower lv as storage of drbd as pv for some upper vg setup.
 
> I snapshot the underlying LVM Volumes readonly and do rsync style
> rotating Backups with the help of dirvish (http://www.dirvish.org/).

you probably should snapshot them rw, so the file system is able to
replay its journal. you obviously should mount them ro, of course.

> To have consistent backups of my MySQL Databases I have a small perl-skript
> that runs before the backup which commits a "FLUSH TABLES WITH READ
> LOCK" to the MySQL Database. After the skript has taken the LVM Snapshot
>  via "system" calls I do "UNLOCK TABLES" so the tables are unlocked.

right. so you know that at least the the mysql tables are consistent
in the snapshot.

> Usually this takes about 1-3 seconds and sessions that attempt to write
> to MySQL wait longer for response so that only a short lock can be detected.

-- 
: Lars Ellenberg                            Tel +43-1-8178292-0  :
: LINBIT Information Technologies GmbH      Fax +43-1-8178292-82 :
: Vivenotgasse 48, A-1120 Vienna/Europe    http://www.linbit.com :
__
please use the "List-Reply" function of your email client.



More information about the drbd-user mailing list