Linux Views 11

Setting up DRBD on Linux, part 1

Setting up DRBD on Linux, part 1 image 1

DRBD is a network RAID-1 utility for putting block devices into an HA setup.
DRBD provides a virtual drbd device that virtually mounts the devices on two servers and mirrors them.
The states are primary and secondary. Computation is possible only on the primary, and the secondary keeps mirroring the primary.

Installing DRBD


Install the drbd package.

 apt-get install -y drbd8-utils
 modprobe drbd


Install it on both nodes.

Configuring the DRBD node environment


Save both nodes in /etc/hosts.

 node1 10.10.10.1
 node2 10.10.10.2


The DRBD nodes need a separate drive on which to mount the virtual disk. Example: /dev/sdb

Then write /etc/drbd.d/nfs.res. (The .res file name can be anything.)

 resource "nfs"
 {
         protocol C;
         disk {on-io-error detach;}
         syncer {
         }

         on node1 {
         device /dev/drbd0;
         disk /dev/sdb1;
         address 10.10.10.1:7791;
         meta-disk internal;
         }

         on node2 {
         device /dev/drbd0;
         disk /dev/sdb1;
         address 10.10.10.2:7791;
         meta-disk internal;
         }
 }

Create it on both nodes that will use DRBD.
That completes the setup.

Part 2

https://librat.kr/entry/DRBD-구성하기-2

Setting up DRBD on Linux, part 2

Reactions

Comments 0

A nickname and a password are required. The same password edits or deletes the comment later. Comments appear after a review.

Comments appear after a review. The password is used again to edit or delete.