You need three configuration files:
A file for the PostgreSQL primary resource
A file for the PostgreSQL standby resource
A file for the Rolechanger resource for WAL file shipping without shared storage configuration
In addition to these requirements, you also need to customize copies of resilver-step1 and resilver-step2.
The configuration files are as follows:
pgs_primary_config for the primary resource
pgs_standby_config for the standby resource
rolechg_config for the Rolechanger resource
Modified copy of the resilver-step1 script
Modified copy of the resilver-step2 script
This example shows a pgs_primary_config file, a pgs_standby_config file, and a rolechg_config file with configuration parameters are set.
The key-value pairs and explanation for a sample pgs_primary_config file are follows:
The name of the PostgreSQL resource is postgres-prim-rs.
The name of the resource group for the PostgreSQL resource is postgres-prim-rg.
The value for the dummy port for the PostgreSQL resource is 80.
SUNW.LogicalHostname resource is not present in postgres-sta-rg.
SUNW.HAStoragePlus resource is not present in postgres-sta-rg.
The parameter file is generated in /postgres/pfile.
Specifies a global zone configuration.
Specifies a global zone configuration.
Specifies a global zone configuration.
The name of the Oracle Solaris user who owns PostgreSQL is pgs.
The PostgreSQL software is installed in /postgres/postgresql-8.3.1.
The PostgreSQL data and configuration files are installed under /postgres/data.
The PostgreSQL database server listens on port 5432.
The log file for the database server is /postgres/logs/scinstance1.
The libraries for the PostgreSQL server are stored in the paths of LD_LIBRARY_PATH/usr/sfw/lib:/usr/local/lib:/usr/lib directory.
Additional PostgreSQL variables are set in /global/postgres/variables.ksh.
The monitored database is testdb.
The user for the database monitoring is testusr.
The table testtb1 is modified to probe the condition of the database.
The password for the user testusr is testpwd, although it is not specified.
If a connection to the database testdb fails , the probe returns with return code 10.
The resource name of the PostgreSQL standby resource is postgres-sta-rs.
The resource group name of the PostgreSQL standby resource group is postgres-sta-rg.
The user who owns the PostgreSQL standby database is pgs.
The name of the standby host is phys-node2.
The parameter file of the PostgreSQL standby resource is /postgres/pfile.
The Rolechanger resource name has a null value because it is not needed on the primary.
The SSH_PASSDIR has a null value to indicate that the sshkeys are not protected by a passphrase.
The key-value pairs and explanation for a pgs_standby_config file are as follows:
The name of the PostgreSQL resource is postgres-sta-rs.
The name of the resource group for the PostgreSQL resource is postgres-sta-rg.
The value for the dummy port for the PostgreSQL resource is 80.
SUNW.LogicalHostname resource is not present in postgres-sta-rg.
SUNW.HAStoragePlus resource is not present in postgres-sta-rg.
The parameter file is generated in /postgres/pfile.
The null value indicates that it is a global zone configuration.
The null value indicates that it is a global zone configuration.
The null value indicates that it is a global zone configuration.
The name of the Oracle Solaris user who owns PostgreSQL is pgs.
The PostgreSQL software is installed in /postgres/postgresql-8.3.1.
The PostgreSQL data and configuration files are installed under /postgres/data.
The PostgreSQL database server listens on port 5432.
The log file for the database server is /postgres/logs/scinstance1.
The libraries for the PostgreSQL server are stored in the paths of the LD_LIBRARY_PATH/usr/sfw/lib: /usr/local/lib: /usr/lib: directory.
Additional PostgreSQL variables are set in /global/postgres/variables.ksh.
The monitored database is testdb.
The user for the database monitoring is testusr.
The table testtb1 is modified to probe the condition of the database.
The password for the user testusr is testpwd, although it is not specified.
If a connection to the database testdb fails, the probe returns with return code 10.
The value for the STDBY_RS is not required in a standby configuration.
The value for STDBY_RG is not required in a standby configuration.
The value for STDBY_USER is not required in a standby configuration.
The value for STDBY_HOST is not required in a standby configuration.
The value for STDBY_PARFILE is not required in a standby configuration.
The Rolechanger resource is rolechg-rs.
The SSH_PASSDIR has a null value , which means that the sshkeys are not protected by a passphrase.
The key-value pairs and explanation for configuration file rolechg-config are as follows:
The name of the Rolechanger resource is rolechg-rs.
The name of the resource group for the PostgreSQL resource is rolechg-rg.
The value of the dummy port for the PostgreSQL resource is 5432.
The resource name for the SUNW.LogicalHostname resource is pgs-1h-1.
SUNW.HAStoragePlus resource or other dependencies are not present.
The name of the PostgreSQL standby resource is postgres-sta-rs.
The name of the PostgreSQL primary resource is postgres-prim-rs.
The physical node name of the standby is phys-node2.
The parameter file on the standby is /postgres/pfile.
The trigger file on which the pg_standby utility reacts is phys-node2.
After the resource is started, Rolechanger waits for 30 seconds until it touches the trigger file.
Modifications in a copy of resilver-step1"
PGDATA of the standby is in /postgres/data.
PGDATA of the primary is in /postgres/data.
Specifies the name of the target node. The usual name is the name of the designated primary node.
Specifies the PostgreSQL base directory, where the PostgreSQL binaries are located.
Specifies the resource group that contains the cluster resource of the designated primary.
Specifies the resource group that contains the cluster resource of the designated standby.
Specifies the database port.
Specifies the resource group that contains the Rolechanger resource.
Specifies the absolute path to the RSYNC command, including the necessary options.
Specifies whether your ssh key is secured by a passphrase or not.
Modifications in a copy of resilver-step2:
The source node is phys-node2.
PGDATA of the standby is in /postgres/data.
PGDATA of the primary is in /postgres/data.
The target node is phys-node1.
Specifies the PostgreSQL base directory, where the PostgreSQL binaries are located.
Specifies the resource group which contains the cluster resource of the designated primary.
The resource group for the standby resource is postgres-sta-rg.
Specifies the resource group which contains the cluster resource of the designated standby.
Specifies the database port.
The resource group for the Rolechanger resource group is rolechg-rg.
The primary node is the global zone of phys-node1.
Specifies the absolute path to the RSYNC command including the necessary options.
Specifies whether your ssh key is secured by a passphrase or not.