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

Setting up a simple cluster


Once the installation has been done, it is time to get started and actually set up a simple cluster. In this scenario, a cluster consisting of three nodes will be created.

Note that all the data nodes will be on the same physical box in order to make life easier for beginners.

Arranging storage

The first thing administrators have to do is create some space for PostgreSQL. In this simplistic example, just three directories are created:

[root@localhost ~]# mkdir /data
[root@localhost ~]# mkdir /data/node1 /data/node2 /data/node3

Make sure that these directories belong to postgres (if PostgreSQL is really running as postgres, which is usually a good idea):

[root@localhost ~]# cd /data/
[root@localhost data]# chown postgres.postgres node*

Once these directories have been created, everything needed for a successful setup is in place:

[root@localhost data]# ls -l
total 0
drwxr-xr-x 2 postgres postgres 6 Apr 11 05:51 node1
drwxr-xr-x 2 postgres postgres 6 Apr 11 05:51 node2...