Lab: Intro To DRBD

Introduction

DRBD is software based data replication solution that is commonly used to build small high availability clusters. In the next lab we will build such a cluster. Today we will concentrate just on DRBD.

Recommended O/S: Debian Bookworm


Part A: Orientation

The DRBD Users Guide, from LINBIT, is an example of an excellently written manual.

  1. Review the User's Guide for version 8.4 paying special attention to the following sections:

Part B: Build a DRBD configuration

Now that you know what DRBD is, it's time to consolidate your knowledge by building a simple test deployment.

Lab Diagram

  1. Use one disk on each node for the O/S and one for DRBD
  2. Create two replicated volumes, each 4 GB in size
  3. Mount the DRBD volumes at /ha/data1 and /ha/data2

Notes:

  1. The bookworm course appliance is a good starting point for luke and yoda.
    apt update && apt install drbd-utils
    
  2. The default global_comman.conf does not need to be changed.

Part C: Test

Let's see DRBD to it's thing.

  1. To test what happens if the communication link is severed, "unplug" one of the nodes from the red network.
    1. What was reported on each node?
    2. Does the primary still function?
    3. What happens when the link is restored?
  2. To simulate a node crash of the secondary, power off the secondary node
    1. What happened?
    2. How did you recover?
  3. To simulate a node crash of the primary, power off the primary node
    1. What happened?
    2. How did you recover?
  4. optional advance: We can simulate a disk failure by removing the disk from the kernel's device table.
    # make note of the SCSI ID of our DRBD disk
    lsscsi
    
    # use the address we just found to remove the device from the kernel (this change does not survive a reboot)
    # NOTE: double check the address
    echo 1 > /sys/bus/scsi/devices/2\:0\:0\:0/delete
    

Part D: Better Tests

The tests we performed in Part C would be much more meaningful if the system was reading and writing from the DRBD volumes. Let's redo those tests, but with some activity on the systems.

  1. Write a script or program that will create,read, and write files, 'as fast as it can' (or ask your instructor for such a script - see grading for details)
  2. Re-run the tests from Part C with your script running.

Part E: Grading

This lab is worth a total of 10 points. Grades will be awarded as follows: