[DRBD-user] Building a VM based HA NFS setup over LVM and DRBD

steve steve at asobisoft.com
Thu Nov 18 02:37:28 CET 2010

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


Dear Felix,

Thank you for your reply. Yes, the DRBD is the PV for the LVM volume
groups. I have multiple volumes in the volume group. One of the volumes
I created specifically for the NFS and made it an ext3 volume. This I
have mounted as a drive from a virtual machine residing in the same
setup (the boot drive for the VM is a separate logical volume). When I
tested it, it was showing the volumes were up to date in /proc/drbd, but
if I mounted the volume on the master and created a file or directory,
then unmounted it and switched to the slave NFS VM, the file wouldn't be
there.

As it seems this is possible, and DRBD is doing it's job, then perhaps
it is an issue with how I have mounted the volume or setup heartbeat. I
will experiment some more.

Many thanks,

Steve

On Wed, 2010-11-17 at 15:40 +0100, Felix Frank wrote:
> On 11/17/2010 01:28 PM, Steve in Tokyo wrote:
> > 
> > Hi All,
> > 
> > I am new to DRBD and have what is likely a silly question, I hope this is
> > the appropriate place to ask and apologize if it isn't.
> > 
> > I have built a 2 node Proxmox cluster and am using LVM over DRBD, with DRBD
> > in dual primary mode. It seems to be running flawlessly and I am very happy.
> > I have been able to live migrate an asterisk box while in a conversation
> > without even noticing, and now I am hooked.
> > 
> > I wanted to experiment with High Availability and decided to build an NFS
> > setup with heartbeat. I would like to do this with Virtual machines running
> > on the Proxmox cluster. Through my experimentation I have found that I can
> > mount the LVM volumes as a drive in KVM based VMs (1 NFS server on the
> > master and the 2nd on a Node), and have heartbeat automatically fail them
> > over. However, the two LVM volumes don't seem to sync up properly. If I copy
> > a file to the volume on the master, stop heartbeat, the secondary will
> > pickup the IP address, mount the volume, but the newly copied files won't be
> > there, even if I wait a minute before performing the failover.
> > 
> > I am wondering if what I am trying is even possible. As I said I am very new
> > to this, and have been reading as much as I can. I am viewing the DRBD setup
> > as a physical device, and thought that the writes would be automatically
> > replicated. I am wondering if because I am writing to the logical volume
> > from the VMs directly if the DRBD aspect is bypassed, or if there is
> > something else I am missing (I am sure there is much I am missing). Thanks
> > in advance.
> 
> Do I understand this correctly: The DRBD device is the PV for your LVM VGs?
> Then all writes are indeed replicated.
> 
> Make sure the nodes are connected and both in the UpToDate state.
> 
> If the DRBD device was created on top of an LV instead, you must never
> mount any fs in such an LV directly, much less change files therein.
> 
> HTH,
> Felix





More information about the drbd-user mailing list