JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Cluster Data Service for PostgreSQL Guide
search filter icon
search icon

Document Information

Preface

1.  Installing and Configuring HA for PostgreSQL

HA for PostgreSQL Overview

Overview of Installing and Configuring HA for PostgreSQL

Planning the HA for PostgreSQL Installation and Configuration

PostgreSQL and Solaris Containers

PostgreSQL WAL Shipping

Configuration Restrictions

Restriction for the Location of the Database Cluster

Restriction for the Listening Policy of the PostgreSQL Database Server

Restriction for the PostgreSQL postgresql.conf File

Restriction for the Password Policy for the HA for PostgreSQL Monitoring Database

Restriction for the PostgreSQL smf Service Name in an HA Container

Restriction for the PostgreSQL WAL File Shipping Without Shared Storage

Configuration Requirements

Dependencies Between HA for PostgreSQL Components

Parameter File for HA for PostgreSQL

Configuration Requirements for the WAL File Shipping Without Shared Storage Configuration

Installing and Configuring PostgreSQL

How to Enable a PostgreSQL Database to Run in a Global Zone Configuration

How to Install and Configure PostgreSQL in a Global Zone

How to Enable a Zone to Run PostgreSQL in a Zone Configuration

How to Install and Configure PostgreSQL in a Zone

How to Enable a Zone to Run PostgreSQL in an HA Container Configuration

How to Install and Configure PostgreSQL in an HA Container

Verifying the Installation and Configuration of PostgreSQL

How to Verify the Installation and Configuration of PostgreSQL

Installing the HA for PostgreSQL Packages

How to Install the HA for PostgreSQL Packages

Registering and Configuring HA for PostgreSQL

Specifying Configuration Parameters for the PostgreSQL Resource

Specifying the Parameters for the Rolechanger Resource.

Specifying Configuration Files for WAL File Shipping Without Shared Storage

Preparing Your PostgreSQL Installation for Cluster Control

How to Prepare Your PostgreSQL for Oracle Solaris Cluster Registration in a Global Zone Configuration

How to Prepare Your PostgreSQL for Oracle Solaris Cluster Registration in an HA Container Configuration

Creating and Enabling Resources for PostgreSQL

How to Create and Enable Resources for PostgreSQL

How to Modify Parameters in the HA for PostgreSQL Manifest

How to Remove a HA for PostgreSQL Resource From an HA Container

How to Create and Enable Resources for PostgreSQL Rolechanger

Verifying the HA for PostgreSQL Installation and Configuration

How to Verify the HA for PostgreSQL Installation and Configuration

How to Verify the Solaris Cluster HA for PostgreSQL WAL File Shipping Installation and Configuration

Tuning the HA for PostgreSQL Fault Monitor

Operation of the HA for PostgreSQL Parameter File

Operation of the Fault Monitor for HA for PostgreSQL

Debugging HA for PostgreSQL

How to Activate Debugging for HA for PostgreSQL

A.  Files for Configuring Solaris Cluster HA for Solaris PostgreSQL Resources

B.  Deployment Example: Installing PostgreSQL in the Global Zone

C.  Deployment Example: Installing PostgreSQL in a Non-Global HA Container

D.  Deployment Example: Installing PostgreSQL in a Non-Global Zone

E.  Deployment Example: Installing PostgreSQL in the Global Zone Using WAL File Shipping

Index

Planning the HA for PostgreSQL Installation and Configuration

This section contains the information you need to plan your HA for PostgreSQL installation and configuration.

PostgreSQL and Solaris Containers

HA for PostgreSQL is supported in Solaris Containers, Oracle Solaris Cluster is offering two concepts for Solaris Containers.

PostgreSQL WAL Shipping

The PostgreSQL agent offers three options for a cluster configuration. In these three options, two options leverage the Write Ahead Log (WAL) file shipping features and require the installation of PostgreSQL pg_standby utility. The various options for cluster configuration are the following:

Configuration Restrictions

The configuration restrictions in the subsections that follow apply only to HA for PostgreSQL.


Caution

Caution - Your data service configuration might not be supported if you do not observe these restrictions.


Restriction for the Location of the Database Cluster

The PostgreSQL database cluster is where the database files and the configuration files are stored. The database cluster, represented by the configuration variable PGDATA, needs to be placed on the shared storage.

Restriction for the Listening Policy of the PostgreSQL Database Server

HA for PostgreSQL requires that the PostgreSQL listens at the localhost. Otherwise the monitoring of your data service will not work. For more information, see Preparing Your PostgreSQL Installation for Cluster Control.

Restriction for the PostgreSQL postgresql.conf File

The postgresql.conf file is one of the central configuration files for a specific PostgreSQL database cluster.

The postgresql.conf file must be stored in the PGDATA path. You cannot register HA for PostgreSQL if the file postgresql.conf is not in the directory referenced in the PGDATA variable. The other configuration files can be kept elsewhere. For more information about registration, see Registering and Configuring HA for PostgreSQL.

Restriction for the Password Policy for the HA for PostgreSQL Monitoring Database

HA for PostgreSQL requires a database to which it can connect and where it can manipulate a table for monitoring purposes. The password policy of this database for access from the localhost must be either trust or password. All other password policies can be whatever is applicable. For more information about setting the password policy, see Registering and Configuring HA for PostgreSQL. For more information about the password policy, go to http://www.postgresql.org.

Restriction for the PostgreSQL smf Service Name in an HA Container

The PostgreSQL configuration in an HA container uses the smf component of Oracle Solaris Cluster HA for Solaris Containers. The registration of the HA for PostgreSQL data service in an HA container defines an smf service to control the PostgreSQL database. The name of this smf service is generated in this naming scheme: svc:/application/sczone-agents:resource-name. No other smf service with exactly this name can exist.

The associated smf manifest is automatically created during the registration process in this location and naming scheme: /var/svc/manifest/application/sczone-agents/resource-name.xml. No other manifest can coexist with this name.

Restriction for the PostgreSQL WAL File Shipping Without Shared Storage

The pg_standby utility must be configured with a trigger file after a failover from the primary to the standby triggering a role conversion. An automatic failback cannot occur because the old primary is now out of synchronization. To invoke an actual copy, the PostgreSQL user needs to copy, customize, and execute the two example scripts :resilver-step1 and resilver-step2.

To minimize the data loss on a planned failover, you should switch the PostgreSQL transaction logs before you perform the failover. For information about switching transaction logs, see http://www.postgresql.org.


Note - The PostgreSQL WAL file Shipping without shared storage configuration cannot be deployed with HA containers managed by the HA container agent.


Configuration Requirements

The configuration requirements in this section apply only to HA for PostgreSQL.


Caution

Caution - If your data service configuration does not conform to these requirements, the data service configuration might not be supported.


Dependencies Between HA for PostgreSQL Components

The dependencies between the HA for PostgreSQL components are described in the following table.

Table 1-2 Dependencies Between HA for PostgreSQL Components

Component
Dependency
PostgreSQL resource in a Solaris 10 global zone,zone or in Solaris 9
SUNW.HAStoragePlus This dependency is required only if the configuration uses a failover file system, of file systems in a zone.

SUNW.LogicalHostName

PostgreSQL resource in a Solaris 10 HA container.
Oracle Solaris Cluster HA for Solaris Containers boot resource.

SUNW.HAStoragePlus

SUNW.LogicalHostName — This dependency is required only if the zones boot resource does not manage the zone's IP address.

You set these dependencies, when you register and configure HA for PostgreSQL. For more information, see Registering and Configuring HA for PostgreSQL.

If more elaborate dependencies are required, see the r_properties(5) and rg_properties(5) man pages for further dependencies and affinities settings.

Parameter File for HA for PostgreSQL

HA for PostgreSQL requires a parameter file to pass configuration information to the data service. You must create a directory for this file. Because the directory must be available on each node that is to host the PostgreSQL database, place the directory on the shared storage. If HA for PostgreSQL is configured for an HA container, this file must be available in this zone. The parameter file is created automatically when the resource is registered.

Configuration Requirements for the WAL File Shipping Without Shared Storage Configuration

For the WAL file shipping without shared storage configuration, the rsync utility is required. As an additional requirement, you need to link some PostgreSQL configuration files outside the PGDATA directory. Otherwise these files are destroyed during the resilvering of the primary database. Information about how to perform these steps is available in the comments of the resilver1 script. The PostgreSQL users on both nodes require a nonpassword login on each node.