Product SiteDocumentation Site

8.3. Configure DRBD

There is no series of commands for building a DRBD configuration, so simply run this on both nodes to use this sample configuration:
# cat <<END >/etc/drbd.d/wwwdata.res
resource wwwdata {
 protocol C;
 meta-disk internal;
 device /dev/drbd1;
 syncer {
  verify-alg sha1;
 }
 net {
  allow-two-primaries;
 }
 on pcmk-1 {
  disk   /dev/centos_pcmk-1/drbd-demo;
  address  192.168.122.101:7789;
 }
 on pcmk-2 {
  disk   /dev/centos_pcmk-2/drbd-demo;
  address  192.168.122.102:7789;
 }
}
END

Important

Edit the file to use the hostnames, IP addresses and logical volume paths of your nodes if they differ from the ones used in this guide.

Note

Detailed information on the directives used in this configuration (and other alternatives) is available in the DRBD User’s Guide. The allow-two-primaries option would not normally be used in an active/passive cluster. We are adding it here for the convenience of changing to an active/active cluster later.