Atom feed of this document
  
 

 Configuring DRBD

The Pacemaker based MySQL server requires a DRBD resource from which it mounts the /var/lib/mysql directory. In this example, the DRBD resource is simply named mysql:

mysql DRBD resource configuration (/etc/drbd.d/mysql.res). 

resource mysql {
  device    minor 0;
  disk      "/dev/data/mysql";
  meta-disk internal;
  on node1 {
    address ipv4 10.0.42.100:7700;
  }
  on node2 {
    address ipv4 10.0.42.254:7700;
  }
}

This resource uses an underlying local disk (in DRBD terminology, a backing device) named /dev/data/mysql on both cluster nodes, node1 and node2. Normally, this would be an LVM Logical Volume specifically set aside for this purpose. The DRBD meta-disk is internal, meaning DRBD-specific metadata is being stored at the end of the disk device itself. The device is configured to communicate between IPv4 addresses 10.0.42.100 and 10.0.42.254, using TCP port 7700. Once enabled, it will map to a local DRBD block device with the device minor number 0, that is, /dev/drbd0.

Enabling a DRBD resource is explained in detail in the DRBD User’s Guide. In brief, the proper sequence of commands is this:

drbdadm create-md mysql  1
drbdadm up mysql  2
drbdadm -- --force primary mysql  3

1

Initializes DRBD metadata and writes the initial set of metadata to /dev/data/mysql. Must be completed on both nodes.

2

Creates the /dev/drbd0 device node, attaches the DRBD device to its backing store, and connects the DRBD node to its peer. Must be completed on both nodes.

3

Kicks off the initial device synchronization, and puts the device into the primary (readable and writable) role. See Resource roles (from the DRBD User’s Guide) for a more detailed description of the primary and secondary roles in DRBD. Must be completed on one node only, namely the one where you are about to continue with creating your filesystem.

Questions? Discuss on ask.openstack.org
Found an error? Report a bug against this page

loading table of contents...