Hands-on lab demonstrating block-level storage replication and manual failover between two CentOS Stream 10 nodes using DRBD 9.
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.
- 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
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.
- Configured
/etc/hostson both nodes and verified network connectivity. - Installed the DRBD kernel module and DRBD 9 utilities.
- Loaded the module and confirmed it was active.
- Identified the dedicated backing disks on both nodes.
- Created and validated the
resource0configuration. - Initialized DRBD metadata and brought the resource online.
- Promoted
serverto Primary and completed the initial synchronization. - Created an XFS filesystem on
/dev/drbd0and mounted it at/mnt/drbd. - Created a test file and verified the replicated data after failover to
client.
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.
The final validation confirmed:
- Both disks reported
UpToDate. - The test file remained available after role reversal.
clientoperated as Primary after failover.serveroperated as Secondary after failover.
The complete illustrated walkthrough is available in docs/DRBD_Lab_Report.pdf.
- 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
- 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.
Hasan Mohammed Badwan
Cybersecurity Student | Aspiring Malware Analyst & Network Security Engineer