Book Image

PostgreSQL Replication, Second Edition

Book Image

PostgreSQL Replication, Second Edition

Overview of this book

Table of Contents (22 chapters)
PostgreSQL Replication Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Configuring a simple cluster


In this chapter, we want to set up a cluster consisting of three data nodes. A Coordinator and a GTM will be in charge of the cluster. For each component, we have to create a directory:

[hs@localhost data]$ ls -l
total 0
drwxrwxr-x 2 hs hs 6 Feb 26 01:16 gtm
drwxrwxr-x 2 hs hs 6 Feb 26 01:16 node1
drwxrwxr-x 2 hs hs 6 Feb 26 01:16 node2
drwxrwxr-x 2 hs hs 6 Feb 26 01:16 node3
drwxrwxr-x 2 hs hs 6 Feb 26 01:16 node4

Keep in mind that, to make life simple, we will set up the entire cluster on a single server. In production, you would logically use different nodes for different components. It is not very common to use many XC nodes on the same box to speed things up.

Creating the GTM

In the first step, we have to initialize the directory that handles the GTM. To do so, we can simply call initgtm:

[hs@localhost data]$ initgtm -Z gtm /data/gtm/
The files belonging to this GTM system will be owned by user "hs".
This user must also own the server process.


fixing permissions...