[DRBD-user] Multiple volumes per resource - replication consistency

Anton Polyakov polyakov.anton at gmail.com
Tue Jan 1 08:53:50 CET 2019


Hi Guys



Happy new year!



I would like to have two volumes (say /dev/data and /dev/binlog) which are
used by the same application to be synchronized from my primary node to the
other node (bin logs and data dir of MySQL). In DRBD docs it says that
resource is a replication group containing multiple volumes and “*DRBD* ensures
write fidelity across all *volumes* in the *resource*.”.

MySQL writes data to bin log and data log volumes and data dir contains
snapshot while binlog contains dirty segments. There is a relation between
the two - binlogs periodically merged back to data volume and purged, so to
recover on the other side data volume must contain recent enough snapshot
such that binlogs can be applied on top of it.

Following that I need two volumes to maintain write causality and be
replicated strictly together – i.e. avoid situation when one volume lags or
doesn’t replicate while the other one does, otherwise when I failover on
the other side I will observe inconsistent picture.


I put the following configuration to DRBD:


resource mysql_resource {

       startup {

               wfc-timeout     1;

        }

       disk {

               no-disk-flushes;

               no-md-flushes;

               fencing resource-and-stonith;

               on-io-error call-local-io-error;

               disk-timeout 0;

        }

       volume 0 {

               device    /dev/drbd1;

               disk      /dev/data;

               meta-disk internal;

        }

        volume 1 {

               device    /dev/drbd2;

               disk      /dev/binlog;

               meta-disk internal;

        }



        on ip-10-15-0-135 {

               address   10.15.0.135:1120;

        }

        on peer-host {

               address   10.15.1.61:1120;

        }

}



Now two questions:

   1. Can I achieve such consistency guarantees by using DRBD resource with
   two volumes?
   2. If yes and a resource is a single logical replication unit (in a
   sense of described guarantees), why are GIs different per volume? Can I
   have situations when only one volume is disconnected or needs to resync?
   Can I have situations when one volume is Priomary/Secondary while the other
   is Secondary/Primary?



*Anton Polyakov*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linbit.com/pipermail/drbd-user/attachments/20181231/8f49cfb1/attachment-0001.htm>


More information about the drbd-user mailing list