Sun Cluster Data Service for PostgreSQL Guide for Solaris OS

ProcedureHow to Prepare Your PostgreSQL for Sun Cluster Registration in a Global Zone Configuration

Before You Begin

Ensure that you have edited the pgs_config file to specify configuration parameters for the Sun Cluster HA for PostgreSQL data service. For more information, see Specifying Configuration Parameters for the PostgreSQL Resource.

  1. As superuser change the rights of the configuration file to be accessible for your PostgreSQL user.


    # chmod 755 /myplace/pgs_config 
    
  2. Switch to your PostgreSQL user.


    # su - postgres
    
  3. If the login shell is not the Korn shell, switch to ksh.


    % ksh
    
  4. Set the necessary variables.


    $ . /myplace/pgs_config
    $ export PGDATA PGPORT LD_LIBRARY_PATH
    
  5. If your PostgreSQL is not already running, start the PostgreSQL server.


    $ $PGROOT/bin/pg_ctl -l $PGLOGFILE start
    
  6. Prepare the database.


    $ /opt/SUNWscPostgreSQL/util/pgs_db_prep -f /myplace/pgs_config
    
  7. (Optional) Configure your PostgreSQL instance to listen on the logical host's TCP/IP name.

    If you want your PostgreSQL databases to listen on more than localhost, configure the listen_address parameter in the file postgresql.conf. Use a plain text editor such as vi, and set the value of listen_address to an appropriate value.


    Caution – Caution –

    The PostgreSQL instance must listen on localhost. For additional information, see http://www.postgresql.org.


    listen_address = 'localhost,myhost'
  8. Set the security policy for the test database.

    Use a plain text editor such as vi to add the following line to the file pg_hba.conf.

    local   testdb         all                               password

    Note –

    For additional information about the pg_hba.conf file, see http://www.postgresql.org.


  9. Stop the PostgreSQL database server.


    $ $PGROOT/bin/pg_ctl stop