Go to main content

Oracle® Solaris Cluster Data Service for PostgreSQL Guide

Exit Print View

Updated: June 2017
 
 

Creating and Enabling Resources for PostgreSQL

How to Create and Enable Resources for PostgreSQL

Before You Begin

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

  1. Become the root role on one of the nodes in the cluster that will host PostgreSQL.
  2. Go to the directory that contains the script for creating the HA for PostgreSQL resource.
    # cd /opt/SUNWscPostgreSQL/util
  3. Run the script that creates the PostgreSQL resource.
    • If you specified the password for the monitoring user in the configuration file or if you do not have a password, do the following:
      # ksh ./pgs_register -f /myplace/pgs_config
    • If you have a password and do not want to store it in clear text form, do the following:
      1. Perform the following command on one node of the cluster.
        # ksh ./pgs_register -f /myplace/pgs_config -e
      2. Perform the following command on the node where your shared storage is online.
        # ksh ./pgs_register -f /myplace/pgs_config

    If you omit the –f option, the file /opt/SUNWscPostgreSQL/util/pgs_config is used.

  4. Bring the PostgreSQL resource online.
    # clresource enable postgres-rs

How to Modify Parameters in the HA for PostgreSQL Manifest

Perform this task to change parameters in the HA for PostgreSQL manifest and to validate the parameters in the HA container. Parameters for the HA for PostgreSQL manifest are stored as properties of the SMF service. To modify parameters in the manifest, change the related properties in the SMF service then validate the parameter changes.

  1. Become the root role or assume a role that provides solaris.cluster.modify and solaris.cluster.admin authorizations on the zones console.
  2. Change the Oracle Solaris Service Management Facilities (SMF) properties for the HA for PostgreSQL manifest.
    # svccfg svc:/application/sczone-agents:resource

    For more information, see the svccfg(1M) man page.

  3. Validate the parameter changes.
    # /opt/SUNWscPostgreSQL/bin/control_pgs validate resource

    Messages for this command are stored in the /var/adm/messages/ directory of the HA container.

  4. Disconnect from the HA for Solaris Zones console.

How to Remove a HA for PostgreSQL Resource From an HA Container

  1. Become the root role or assume a role that provides solaris.cluster.modify and solaris.cluster.admin authorizations.
  2. Disable and remove the resource that is used by the HA for PostgreSQL data service.
    # clresource disable resource
    # clresource delete resource
  3. Log in as the root role to the HA for Solaris Zones console.
  4. Unregister HA for PostgreSQL from the Oracle Solaris Service Management Facilities (SMF) service.
    # /opt/SUNWscPostgreSQL/util/pgs_smf_remove -f filename
    –f

    Specifies the configuration file name.

    filename

    The name of the configuration file that you used to register HA for PostgreSQL with the SMF service.


    Note -  If you no longer have the configuration file that you used to register HA for PostgreSQL with the SMF service, create a replacement configuration file:
    1. Make a copy of the default file, /opt/SUNWscPostgreSQL/util/pgs_config.

    2. Set the ZONE and RS parameters with the values that are used by the data service.

    3. Run the pgs_smf_remove command and use the –f option to specify this configuration file.


  5. Disconnect from the HA for Solaris Zones console.

How to Create and Enable Resources for PostgreSQL Rolechanger

Before You Begin

Ensure that you have edited the rolechg_config file to specify configuration parameters for the HA for PostgreSQL Rolechanger data service. For more information, see http://www.postgresql.org.

  1. Become the root role on one of the nodes in the cluster that hosts PostgreSQL.
  2. Go to the directory that contains the script for creating the HA for PostgreSQL Rolechanger resource.
    # cd /opt/SUNWscPostgreSQL/util
  3. Run the script that creates the PostgreSQL resource.
    # ksh ./rolechg_register -f /myplace/rolechg_config

    If you omit the –f option, the file /opt/SUNWscPostgreSQL/rolechg_util/rolechg_config is used.

  4. Bring the PostgreSQL Rolechanger resource online.
    # clresource enable rolechg-rs