Skip Navigation Links
Exit Print View
| Oracle Solaris Cluster Data Service for PostgreSQL Guide Oracle Solaris Cluster 4.1

Search Scope:

- This Document
- Entire Library

## 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=

   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

4. Save and close the files.

Copyright © 2000, 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices |