How to do it...

To keep things simple, we will assume that each server we prepare has a device named /dev/sdb for database storage. Follow these steps as root:

  1. Install the xfsprogs package with apt-get or yum.
  2. Install drbd8-utils with apt-get on Debian-based systems, or drbd with yum on Red Hat derivatives.
  3. In the devices section of /etc/lvm/lvm.conf, change the filter setting to read the following:
        filter = [ "a|/dev/sd.*|", "a|/dev/drbd.*|", "r|.*|" ] 
  1. In the devices section of /etc/lvm/lvm.conf, set these two options to completely disable any caching:
        write_cache_state = 0 
        use_lvmetad = 0 
  1. Remove the existing LVM cache file with the following command:
        rm /etc/lvm/cache/.cache
  1. Execute the following command to validate our LVM ...

Get PostgreSQL High Availability Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.