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

Document Information

Preface

1.  Installing and Configuring HA for PostgreSQL

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

B.  Deployment Example: Installing PostgreSQL in the Global Zone

Target Cluster Configuration

Software Configuration

Assumptions

Installing and Configuring PostgreSQL on Shared Storage in the Global Zone

Example: Preparing the Cluster for PostgreSQL

Example: Configuring Cluster Resources for PostgreSQL

Example: Modifying the PostgreSQL Configuration File

Example: Building and Installing the PostgreSQL Software on Shared Storage

Example: Enabling the PostgreSQL Software to Run in the Cluster

Installing the PostgreSQL Binaries in the Default Directory (Alternative Installation)

Example: Building and Installing the PostgreSQL Software in the Default Directory 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

Example: Enabling the PostgreSQL Software to Run in the Cluster

  1. Create the directories for the databases and the log file.
    phys-schost-1$ mkdir /global/mnt3/postgres/data
    phys-schost-1$ mkdir /global/mnt3/postgres/logs
  2. Change to the PostgreSQL root directory and initialize the data cluster.
    phys-schost-1$ cd /global/mnt3/postgres/postgresql-8.1.0 
    phys-schost-1$ ./bin/initdb -D /global/mnt3/postgres/data
  3. Start the database.
    phys-schost-1$ ./bin/postmaster -D /global/mnt3/postgresql-8.1.0
  4. Prepare the Oracle Solaris Cluster specific test database.
    phys-schost-1$ ksh /opt/SUNWscPostgreSQL/util/pgs_db_prep -f \
    /global/mnt3/pgs_config -e
  5. Stop the postmaster.
    phys-schost-1$ ./bin/pg_ctl -D /global/mnt3/data stop
  6. Exit the postgres user ID.
    phys-schost-1$ exit
  7. Encrypt the password of the monitoring user on all nodes, to run the PostgreSQL resource.
    phys-schost-1$ ksh /opt/SUNWscPostgreSQL/util/pgs_register -f \
    /global/mnt3/pgs_config -e
    phys-schost-2$ ksh /opt/SUNWscPostgreSQL/util/pgs_register \
    /global/mnt3/pgs_config -e
  8. Run the pgs_register script to register the resource.
    phys-schost-1# ksh /opt/SUNWscPostgreSQL/util/pgs_register -f /global/mnt3/pgs_config
  9. Add the following line to the postgresql.conf file in the PGDATA directory.
    listen_addresses = 'localhost,ha-host-1'
  10. Add the following line to the pg_hba.conf file in the PGDATA directory.
    host    all         all        0.0.0.0/0      password
  11. Enable the resource.
    phys-schost-1# clresource enable RS-PGS