How it works...
Do these steps seem familiar? They should! With a few minor exceptions, this is almost the same as the steps we used in the Getting started with the LVM recipe. Unlike the other instructions, we don't need to partition the /dev/drbd0 device and can immediately add it to LVM with pvcreate.
Following this, we use vgcreate to define a new volume group named VG_POSTGRES, containing /dev/drbd0 as its only device. The definition for this volume group actually exists on the /dev/drbd0 device itself, meaning it is replicated by DRBD to the other node. This is why we only need to execute these commands on pg1.
Next, we use lvcreate with the -n parameter to create a logical volume named LV_DATA within the VG_POSTGRES group. This time, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access