Skip to content

About

Two-node DRBD 9 storage replication and manual failover lab on CentOS Stream 10.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

DRBD Two-Node Cluster Lab

Hands-on lab demonstrating block-level storage replication and manual failover between two CentOS Stream 10 nodes using DRBD 9.

Project overview

This project documents the complete setup and validation of a two-node DRBD cluster in an isolated virtual lab. The implementation covers node communication, DRBD installation, resource configuration, metadata creation, initial synchronization, XFS filesystem deployment, and a final failover test.

Lab environment

  • Two CentOS Stream 10 virtual machines
  • DRBD 9 kernel module and utilities
  • One dedicated virtual disk per node
  • Private lab network with hostname-based communication
  • XFS filesystem on the replicated DRBD device

Architecture

                    DRBD protocol C replication
      192.168.199.132:7789 <-> 192.168.199.133:7789
            +-----------------------------------+
            |                                   |
    +-------v--------+                  +-------v--------+
    |     server     |                  |     client     |
    |  /dev/sdb      |                  |  /dev/sdc      |
    |  Primary       |                  |  Secondary     |
    +-------+--------+                  +-------+--------+
            |                                   |
            +------- /dev/drbd0 mirror ---------+
                            |
                       /mnt/drbd

The roles were reversed during the failover test: client became Primary and mounted the replicated filesystem while server became Secondary.

Implementation steps

  1. Configured /etc/hosts on both nodes and verified network connectivity.
  2. Installed the DRBD kernel module and DRBD 9 utilities.
  3. Loaded the module and confirmed it was active.
  4. Identified the dedicated backing disks on both nodes.
  5. Created and validated the resource0 configuration.
  6. Initialized DRBD metadata and brought the resource online.
  7. Promoted server to Primary and completed the initial synchronization.
  8. Created an XFS filesystem on /dev/drbd0 and mounted it at /mnt/drbd.
  9. Created a test file and verified the replicated data after failover to client.

DRBD resource

The reusable resource definition is available in config/resource0.res.

Important: Device names and IP addresses are specific to this private lab. Verify the correct disks before using the configuration in another environment.

Validation

The final validation confirmed:

  • Both disks reported UpToDate.
  • The test file remained available after role reversal.
  • client operated as Primary after failover.
  • server operated as Secondary after failover.

Evidence and report

The complete illustrated walkthrough is available in docs/DRBD_Lab_Report.pdf.

Skills demonstrated

  • Linux storage administration
  • Block-level replication with DRBD 9
  • DRBD resource and metadata configuration
  • Primary/Secondary role management
  • XFS filesystem creation and mounting
  • Replication monitoring and failover validation
  • Linux networking and troubleshooting

Notes

  • This repository is intended for educational and portfolio use.
  • The addresses shown belong to a private virtual lab network.
  • Credentials, private keys, and production data are not included.
  • The demonstrated failover is manual; production high availability normally adds a cluster manager and fencing.

Author

Hasan Mohammed Badwan

Cybersecurity Student | Aspiring Malware Analyst & Network Security Engineer

About

Two-node DRBD 9 storage replication and manual failover lab on CentOS Stream 10.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors