Go to main content

Oracle® Solaris Cluster Data Service for PostgreSQL Guide

Exit Print View

Updated: June 2017
 
 

How to Enable a Non-Global Zone to Run PostgreSQL in an HA for Solaris Zones Configuration

For a complete example of deploying in an HA for Solaris Zones configuration, see Deployment Example: Installing PostgreSQL in a Non-Global Zone With HA for Solaris Zones.

Before You Begin

Ensure that the /etc/netmasks file has IP-address subnet and netmask entries for all logical hostnames. If necessary, edit the /etc/netmasks file to add any missing entries.

  1. As the root role, register the SUNW.HAStoragePlus and SUNW.gds resource types.
    # clresourcetype register SUNW.HAStoragePlus SUNW.gds
  2. Create a failover resource group.
    # clresourcegroup create PostgreSQL-resource-group
  3. Create a resource for the PostgreSQL zone's disk storage.
    # clresource create -t SUNW.HAStoragePlus \
    -p FileSystemMountPoints=PostgreSQL-instance-mount-points \
    PostgreSQL-has-resource
  4. (Optional) If you want the protection against a total adapter failure for your public network, create a resource for the PostgreSQL's logical hostname.
    # clreslogicalhostname create -g PostgreSQL-resource-group \
    PostgreSQL-logical-hostname-resource-name
  5. Place the resource group in the managed state.
    # clresourcegroup online -M PostgreSQL-resource-group
  6. Install the non-global zone.

    Install the zone according to Oracle Solaris Cluster Data Service for Oracle Solaris Zones Guide, assuming that the resource name is pgsql-zone-rs and that the zone name is pgsql-zone.

  7. Verify the zone's installation.
    # zoneadm -z pgsql-zone boot
    # zoneadm -z pgsql-zone halt
  8. Register the zone's boot component.
    1. Copy the zone resource boot component configuration file.
      # cp /opt/SUNWsczone/sczbt/util/sczbt_config zones-target-configuration-file
    2. Use a plain text editor to set the following variables:
      RS=pgsql-zone-rs
      RG=PostgreSQL-resource-group
      PARAMETERDIR=pgsql-zone-parameter-directory
      SC_NETWORK=true|false
      SC_LH=PostgreSQL-logical-hostname-resource-name
      FAILOVER=true|false
      HAS_RS=PostgreSQL-has-resource
      Zonename=pgsql-zone
      Zonebootopt=zone-boot-options
      Milestone=zone-boot-milestone
      Mounts=
    3. Create the parameter directory for your zone's resource.
      # mkdir pgsql-zone-parameter-directory
    4. Execute the Oracle Solaris Cluster HA for Solaris Zones's registration script.
      # /opt/SUNWsczone/sczbt/util/sczbt_register -f zones-target-configuration-file
    5. Enable the HA for Solaris Zones resource.
      # clresource enable pgsql-zone-rs
  9. Enable the resource group.
    # clresourcegroup online PostgreSQL-resource-group