The last part of this chapter focuses on setting up a HA MariaDB database with replicated storage. To begin, we will have to set up another DRBD resource as we did earlier. We will review the necessary steps here for clarity:
Add another virtual disk to each virtual machine (a 2 GB disk will do).
Create a partition on the newly added disk and then go through the process of creating a Physical Volume (PV) on
/dev/
sdc1
, a Volume Group (VG, nameddrbd_db_vg
), and finally a Logical Volume (LV,drbd_db_vol
):parted /dev/sdc mklabel msdos parted /dev/sdc mkpart p 0% 100% pvcreate /dev/sdc1 vgcreate drbd_db_vg /dev/sdc1 lvcreate -n drbd_db_vol -l 100%FREE drbd_db_ vg
Create a configuration file (
/etc/drbd.d/drbd1.res
) for the new DRBD resource (drbd1
), and based on the configuration file for the first replicated storage resource, edit the settings accordingly and use a different port:resource drbd1 { disk /dev/drbd_db_vg/drbd_db_vol...