Book Image

PostgreSQL 9 High Availability Cookbook

By : Shaun Thomas
Book Image

PostgreSQL 9 High Availability Cookbook

By: Shaun Thomas

Overview of this book

Table of Contents (17 chapters)
PostgreSQL 9 High Availability Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Verifying a DRBD filesystem


A semi-common maintenance concern regarding synchronized devices is verification. The question we should always ask ourselves in a high-availability scenario is how confident we are that data on both nodes match.

The drbdadm utility provides a parameter specifically for addressing this need. However, there are some caveats to consider when using it, which we will explain in this recipe.

Getting ready

Follow the recipes defined in all previous sections before starting here. At the very least, we need a fully-operational DRBD node pair to follow this recipe.

How to do it...

Follow these steps as the root user on pg1:

  1. Add this block of text inside the resource section defined in /etc/drbd.d/pg.res:

    net {
      verify-alg md5;
    }
  2. Run this command to make DRBD reread its configuration files:

    drbdadm adjust pg
    
  3. Begin verification with this command:

    drbdadm verify pg
    
  4. Monitor /proc/drbd until verification is complete:

    watch cat /proc/drbd
    
  5. Disconnect and reconnect the DRBD resource...