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

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

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

Index

Example: Modifying the PostgreSQL Configuration File

  1. Modify the PGROOT and PD_LIBRARY_PATH environment variables according to the needs of your build.

    The databases are stored under /postgres/data. The log file is stored under /postgres/logs/sclog.

    phys-schost-1# PGROOT=/postgres/postresql-8.3.1
    phys-schost-1# LD_LIBRARY_PATH=/postgres/postgresql-8.3.1:/usr/sfw/lib: \
    /usr/local/lib:/usr/lib:/opt/csw/lib
    phys-schost-1# export PGROOT
    phys-schost-1# export LD_LIBRARY_PATH

    If you are installing the software in the default directory, set PGROOT to /usr/local/pgsql and LD_LIBRARY_PATH to /usr/local/pgsql/lib:/usr/sfw/lib:/usr/local/lib:/usr/lib:/opt/csw/lib.

  2. Copy the PostgreSQL configuration files from the agent directory to its deployment location.
    phys-schost-1# cp /opt/SUNWscPostgreSQL/util/pgs_config /postgres/pgs_config_pri
    phys-schost-1# cp /opt/SUNWscPostgreSQL/rolechg/util/rolchg_config /postgres \
    /rolechg_config
    phys-schost-2# cp /opt/SUNWscPostgreSQL/util/pgs_config /postgres/pgs_config_sta
  3. Add the cluster information to the configuration files.

    The following list shows the relevant file entries for pgs_config_pri and the values to assign to each entry.

    RS=PRIM-RS
    RG=POSTGRES-PRIM-RG
    PORT=5432
    LH=
    HAS_RS=
    PFILE=PRIM-RS-pfile
    
    
    
    USER=pgs
    PGROOT=/usr/local/pgsql
    PGROOT=/postgres/postgresql-8.3.1
    PGPORT=5432
    PGHOST=pgsql-port
    PGLOGFILE=/postgres/logs/sclog
    # LD_LIBRARY_PATH=/usr/local/pgsql/lib:/usr/sfw/lib:/usr/local/lib:/usr/lib:/opt/csw/lib
    LD_LIBRARY_PATH=/postgres/postgresql-8.3.1/lib:/usr/sfw/lib/opt/csw/lib
    SCDB=sctest
    SCUSER=scusser
    SCTABLE=sctable
    SCPASS=
    STDBY_RS=STA-RS
    STDBY_RG=POSTGRES-STA-RG
    STDBY_USER=pgs
    STDBY_HOST=phys-schost-2
    STDBY_PARFILE=/postgres/STA-RS-pfile
    STDBY_PING=
    ROLECHG_RS=
    SSH_PASSDIR=

    Note - For a local zone installation, use zone 2 as the zone name in the variable STDBY_HOST instead of phys-schost-2.


    The following list shows the relevant file entries for pgs_config_sta and the values to assign to each entry.

    RS=STA-RS
    RG=POSTGRES-STA-RG
    PORT=5432
    LH=
    HAS_RS=
    PFILE=postgres/STA-RS-pfile
    
    
    
    USER=pgs
    PGROOT=/usr/local/pgsql
    PGROOT=/postgres/postgresql-8.3.1
    PGPORT=5432
    PGLOGFILE=/postgres/logs/sclog
    # LD_LIBRARY_PATH=/usr/local/pgsql/lib:/usr/sfw/lib:/usr/local/lib:/usr/lib:/opt/csw/lib
    LD_LIBRARY_PATH=/postgres/postgresql-8.3.1/lib:/usr/sfw/lib/opt/csw/lib
    SCDB=sctest
    SCUSER=scusser
    SCTABLE=sctable
    SCPASS=
    STDBY_RS=
    STDBY_RG=
    STDBY_USER=
    STDBY_HOST=
    STDBY_PARFILE=
    STDBY_PING=
    ROLECHG_RS=ROLECHG-RS
    SSH_PASSDIR=

    The following listing shows the relevant file entries for rolechg_config and the values you need to assign to each entry.

    RS=ROLECHG-RS
    RG=ROLECHG-RG
    PORT=5432
    LH=ha-host1
    FILE=postgres/STA-RS-pfile
    HAS_RS=
    STDBY_RS=STA-RS
    PRI_RS=PRIM-RS
    STDBY_HOST=phys-schost-2
    STDBY_PFILE=/postgres/STA-RS-pfile
    TRIGGER=/postgres/data/failover
    WAIT=20

    Note - For a local zone installation, use the zone name zone 2 in the variable STDBY_HOST instead of phys-schost-2.


  4. Save and close the files.