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

Formatting an XFS filesystem


The next and last part of our stack is the filesystem layer. This is where the PostgreSQL data will reside, so we need to ensure it's allocated properly. Unlike the underlying LVM layers, the filesystem is not so easily modified.

In this recipe, we will discuss some common formatting options and why we recommend them in addition to necessary commands.

Getting ready

Since this is the last layer in our complete stack, we strongly suggest following all the recipes up to Incorporating the second LVM layer before starting here.

How to do it...

Assuming pg1 is our current primary node, follow these steps there as the root user:

  1. Activate the second LVM volume with this command:

    lvchange -a y VG_POSTGRES/LV_DATA
    
  2. Count the number of CPUs on the primary node.

  3. Multiply the CPU count by four.

  4. If the total in the previous step is less than 256, use 256.

  5. Use this command to find the Linux kernel version:

    uname -r
    
  6. For kernel versions 3.0 and above, format the XFS filesystem with this...