Sun Cluster Data Service for PostgreSQL Guide for Solaris OS

ProcedureExample: Enabling the PostgreSQL Software to Run in the Cluster

This task will initialize your database, it is essential, that you perform it on one node only.

  1. Create the directories for the databases and the log file.


    zone-1$ mkdir /global/mnt3/postgres/data
    zone-1$ mkdir /global/mnt3/postgres/logs
    
  2. Change to the PostgreSQL root directory and initialize the data cluster.


    zone-1$ cd /postgres/postgresql-8.1.0 
    zone-1$ ./bin/initdb -D postgres/data
    
  3. Start the database.


    zone-1$ ./bin/postmaster -D /postgresql-8.1.0
    
  4. Prepare the Sun Cluster specific test database.


    zone-1$ ksh /opt/SUNWscPostgreSQL/util/pgs_db_prep -f /tmp/pgs_config
    
  5. Stop the postmaster.


    zone-1$ ./bin/pg_ctl -D /postgres/data stop
    
  6. Add the following line to the /postgres/data/postgresql.conf file.


    listen_addresses = 'localhost,ha-host-1'
    
  7. Add the following line to the /postgres/data/pg_hba.conf file.


    host    all         all        0.0.0.0/0      password
    
  8. Leave the zone.


    zone-1$ exit
    
  9. Run the pgs_register script to register the resource.


    phys-schost-1# ksh /opt/SUNWscPostgreSQL/util/pgs_register -f /global/mnt3/pgs_config
    
  10. Enable the resource.


    phys-schost-1# clresource enable RS-PGS