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

Managing WAL files with walctl


The walctl toolkit provides two extra scripts that a DBA should never have to call manually: walctl_push and walctl_pull. These are intended purely to facilitate the preferred architecture of walctl. However, we also understand that many PostgreSQL servers exist already, and not every cluster is new.

It's actually very likely that at least one clone exists now that such behavior is directly supported by PostgreSQL 9.1 and above. In this recipe, we'll explore how to convert an existing cluster to use walctl for WAL management instead.

Getting ready

This recipe depends on walctl being installed on a primary server and any existing PostgreSQL clones. Please follow the Installing and configuring walctl recipe before continuing.

How to do it...

For this recipe, imagine we have four PostgreSQL servers. The primary PostgreSQL server is pg-primary, and we also have three existing replicas named pg-clone1, pg-clone2, and pg-clone3. Execute this command as the postgres system...