[DRBD-user] drbd+lvm no bueno

Lars Ellenberg lars.ellenberg at linbit.com
Mon Jul 30 12:01:25 CEST 2018

On Fri, Jul 27, 2018 at 10:45:46AM +0000, Eric Robinson wrote:
> > > Lars,
> > >
> > > I put MySQL databases on the drbd volume. To back them up, I pause
> > > them and do LVM snapshots (then rsync the snapshots to an archive
> > > server). How could I do that with LVM below drbd, since what I want is
> > > a snapshot of the filesystem where MySQL lives?
> > 
> > You just snapshot below DRBD, after "quiescen" the mysql db.
> > 
> > DRBD is transparent, the "garbage" (to the filesystem) of the "trailing drbd
> > meta data" is of no concern.
> > You may have to "mount -t ext4" (or xfs or whatever), if your mount and
> > libblkid decide that this was a "drbd" type and could not be mounted. They are
> > just trying to help, really.
> > which is good. but in that case they get it wrong.
> Okay, just so I understand....
> Suppose I turn md4 into a PV and create one volume group
> 'vg_under_drbd0', and logical volume 'lv_under_drbd0' that takes 95%
> of the space, leaving 5% for snapshots.
> Then I create my ext4 filesystem directly on drbd0.
> At backup time, I quiesce the MySQL instances and create a snapshot of
> the drbd disk.
> I can then mount the drbd snapshot as a filesystem?   

Though obviously, those snapshots won't "failover",
in case you have a node failure and failover during the backup.
Snapshots in a VG "on top of" DRBD do failover.

> > > How severely does putting LVM on top of drbd affect performance?
> > 
> > It's not the "putting LVM on top of drbd" part.
> > it's what most people think when doing that:
> > use a huge single DRBD as PV, and put loads of unrelated LVS inside of that.
> > 
> > Which then all share the single DRBD "activity log" of the single DRBD volume,
> > which then becomes a bottleneck for IOPS.
> > 
> I currently have one big drbd disk with one volume group over it and
> one logical volume that takes up 95% of the space, leaving 5% of the
> volume group for snapshots. I run multiple instances of MySQL out of
> different directories. I don't see a way to avoid the activity log
> bottleneck problem.

One LV -> DRBD Volume -> Filesystem per DB instance.
If the DBs are "logically related", have all volumes in one DRBD
resource. If not, separate DRBD resources, one volume each.

But whether or not that would help in your setup depends very much on
the typical size of the changing "working set" of the DBs.

: Lars Ellenberg
: LINBIT | Keeping the Digital World Running
: DRBD -- Heartbeat -- Corosync -- Pacemaker

DRBD® and LINBIT® are registered trademarks of LINBIT
please don't Cc me, but send to list -- I'm subscribed

More information about the drbd-user mailing list