Sun Cluster Data Service for PostgreSQL Guide for Solaris OS

ProcedureHow to Prepare Your PostgreSQL for Sun Cluster Registration in a Failover 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. Also make sure that the package directory of the Sun Cluster HA for PostgreSQL, /opt/SUNWscPostgreSQL, is available in the target zone.

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


    Note –

    Ensure, that your pgs_config file is accessible from your zone. Otherwise, transfer the file to your zone by using appropriate methods.



    # chmod 755 /myplace/pgs_config 
    
  2. Switch to the target zone.


    # zlogin pgsql-zone
    
  3. Switch to the PostgreSQL user.


    # su -  zpostgr
    
  4. If the login shell is not the Korn shell, switch to ksh.


    % ksh
    
  5. Set the necessary variables.


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


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


    $ /opt/SUNWscPostgreSQL/util/pgs_db_prep -f /myplace/pgs_config
    
  8. (Optional) Configure your PostgreSQL instance to listen on the logical hosts 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'
  9. Set the security policy for the test database.

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

    local   testdb         all                               password

    Note –

    For additional information, see http://www.postgresql.org.


  10. Stop the PostgreSQL database server.


    $ $PGROOT/bin/pg_ctl stop
    
  11. Leave the target zone and return to the global zone.