Creating a Replication Cluster

To create a new preamble.sk replication cluster, you execute an init cluster command targeted at number 1. An init cluster command looks like this:

init cluster ( id = node-number, comment = string-literal );

The init cluster command connects to the node (which, by the way, must always be node number 1), creates the cluster namespace, and loads a number of tables, sequences, functions, and views into that namespace.

To create the branches replication cluster, you would execute a slonik script that contains the commands shown in Listing 24.2.

Listing 24.2. initCluster.sk
 #!/usr/local/bin/slonik # File: initCluster.sk include <preamble.sk>; init cluster ( id = @SPRINGFIELD, comment = 'primary node - springfield' ...

Get PostgreSQL, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.