1. Installing and Configuring HA for PostgreSQL
Overview of Installing and Configuring HA for PostgreSQL
Planning the HA for PostgreSQL Installation and Configuration
PostgreSQL and Solaris Containers
Restriction for the Location of the Database Cluster
Restriction for the Listening Policy of the PostgreSQL Database Server
Restriction for the PostgreSQL postgresql.conf File
Restriction for the Password Policy for the HA for PostgreSQL Monitoring Database
Restriction for the PostgreSQL smf Service Name in an HA Container
Restriction for the PostgreSQL WAL File Shipping Without Shared Storage
Dependencies Between HA for PostgreSQL Components
Parameter File for HA for PostgreSQL
Configuration Requirements for the WAL File Shipping Without Shared Storage Configuration
Installing and Configuring PostgreSQL
How to Enable a PostgreSQL Database to Run in a Global Zone Configuration
How to Install and Configure PostgreSQL in a Global Zone
How to Enable a Zone to Run PostgreSQL in a Zone Configuration
How to Install and Configure PostgreSQL in a Zone
How to Enable a Zone to Run PostgreSQL in an HA Container Configuration
Verifying the Installation and Configuration of PostgreSQL
How to Verify the Installation and Configuration of PostgreSQL
Installing the HA for PostgreSQL Packages
How to Install the HA for PostgreSQL Packages
Registering and Configuring HA for PostgreSQL
Specifying Configuration Parameters for the PostgreSQL Resource
Specifying the Parameters for the Rolechanger Resource.
Specifying Configuration Files for WAL File Shipping Without Shared Storage
Preparing Your PostgreSQL Installation for Cluster Control
Creating and Enabling Resources for PostgreSQL
How to Create and Enable Resources for PostgreSQL
How to Modify Parameters in the HA for PostgreSQL Manifest
How to Remove a HA for PostgreSQL Resource From an HA Container
How to Create and Enable Resources for PostgreSQL Rolechanger
Verifying the HA for PostgreSQL Installation and Configuration
How to Verify the HA for PostgreSQL Installation and Configuration
How to Verify the Solaris Cluster HA for PostgreSQL WAL File Shipping Installation and Configuration
Tuning the HA for PostgreSQL Fault Monitor
Operation of the HA for PostgreSQL Parameter File
Operation of the Fault Monitor for HA for PostgreSQL
How to Activate Debugging for HA for PostgreSQL
A. Files for Configuring Solaris Cluster HA for Solaris PostgreSQL Resources
B. Deployment Example: Installing PostgreSQL in the Global Zone
C. Deployment Example: Installing PostgreSQL in a Non-Global HA Container
D. Deployment Example: Installing PostgreSQL in a Non-Global Zone
E. Deployment Example: Installing PostgreSQL in the Global Zone Using WAL File Shipping
This section explains only the special requirements for installing PostgreSQL for use with HA for PostgreSQL. For complete information about installing and configuring PostgreSQL, see http://www.postgresql.org. For complete information about installing and configuring a Solaris Container, see System Administration Guide: Oracle Solaris Containers-Resource Management and Oracle Solaris Zones.
Determine if the sun supplied PostgreSQL is already installed and if the installed version fulfills your requirements. To do this you need to check if at least the three following packages are installed on your system.
|
To determine which PostgreSQL version is installed, submit the following commands.
# su - non-root-user $ postmaster --version
If they are not installed, you need to decide wether you want to install PostgreSQL from the Solaris Media or if you want to build PostgreSQL on your own. If the version does not fulfill your needs, you have to build PostgreSQL on your own.
For each PostgreSQL database that you are installing and configuring choose the following tasks according to your zone type.
Determine whether you have to configure HA for PostgreSQL to run in a global zone, in a zone or in an HA container configuration. The global zone configuration procedure is applicable if you install PostgreSQL on Solaris 9, or in the global zone of Solaris 10. The HA container configuration procedure is applicable if you install PostgreSQL in an HA container.
To install and configure PostgreSQL in a global zone configuration, complete the following tasks:
To install and configure PostgreSQL in a zone configuration, complete the following tasks:
To install and configure PostgreSQL in an HA container configuration, complete the following tasks:
For a complete example of deploying in a global zone, see Appendix B, Deployment Example: Installing PostgreSQL in the Global Zone.
# clresourcetype register SUNW.HAStoragePlus SUNW.gds
# clresourcegroup create PostgreSQL-resource-group
# clresource create -t SUNW.HAStoragePlus \ -p FileSystemMountPoints=PostgreSQL-instance-mount-points \ PostgreSQL-has-resource
# clreslogicalhostname create -g PostgreSQL-resource-group \ PostgreSQL-logical-hostname-resource-name
# clresourcegroup online -M PostgreSQL-resource-group
# mkdir PostgreSQL-instance-mount-points/parameter-dir
For a complete example of deployment in a global zone, see Appendix B, Deployment Example: Installing PostgreSQL in the Global Zone.
Before You Begin
Determine the following requirements for the deployment of PostgreSQL with Oracle Solaris Cluster:
See if the PostgreSQL version that you need is already installed on each cluster node. by searching the most probable root paths where you find bin/postmaster:
|
Determine the number of PostgreSQL resources to deploy.
Determine which cluster file systems will be used by each PostgreSQL resource.
Make sure, that a C compiler, make, and the readline package are installed. These packages are needed to build PostgreSQL from the source code downloads from http://www.postgresql.org .
The following assumptions are made:
The compiler gcc and the gmake package are installed in /usr/sfw.
The readline package is installed under /usr/local.
The PostgreSQL database software will be installed on the shared storage in the directory version in the failover file system /global/postgres.
The PostgreSQL database cluster will be installed in the same file system as the database software, in the directory /global/postgres/data.
The home directory of the postgres user is /global/postgres.
The PostgreSQL build directory is in /tmp/postgres/version, and the software is already downloaded and extracted in this place.
# mkdir /global/postgres
# groupadd -g 1000 postgres
# useradd -u 1000 -g postgres -d /global/postgres -s /usr/bin/ksh postgres # chown -R postgres:postgres /global/postgres
# su - postgres
$ PATH=$PATH:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin $ export PATH
$ LD_LIBRARY_PATH=/usr/sfw/lib:/usr/local/lib:/usr/lib: $ export LD_LIBRARY_PATH
$ cd /tmp/postgres/version
$ ./configure --prefix=/global/postgres/version
$ gmake $ gmake check $ gmake install
For a complete example of deploying in a zone, see Appendix D, Deployment Example: Installing PostgreSQL in a Non-Global Zone.
# clresourcetype register SUNW.HAStoragePlus SUNW.gds
# clresourcegroup create -n node-1:pgs-zone,node-2:pgs-zone PostgreSQL-resource-group
# clresource create -t SUNW.HAStoragePlus \ -p FileSystemMountPoints=PostgreSQL-instance-mount-points \ PostgreSQL-has-resource
# clreslogicalhostname create -g PostgreSQL-resource-group \ PostgreSQL-logical-hostname-resource-name
# clresourcegroup online -M PostgreSQL-resource-group
For a complete example of deploying in an HA container, see Appendix C, Deployment Example: Installing PostgreSQL in a Non-Global HA Container.
Before You Begin
Determine the following requirements for the deployment of PostgreSQL with Oracle Solaris Cluster:
See if the PostgreSQL version that you need is already installed on each cluster node. by searching the most probable root paths where you find bin/postmaster:
|
Determine the number of PostgreSQL resources to deploy.
Determine which cluster file systems will be used by each PostgreSQL resource.
Make sure that a C compiler, make, and the readline package are installed. These packages are needed to build PostgreSQL from the source code downloads from http://www.postgresql.org .
The following assumptions are made:
The zone postgres-zone is installed and configured on every node.
The compiler gcc and the gmake package are installed in /usr/sfw.
The readline package is installed under /usr/local.
The PostgreSQL database software will be installed on the shared storage, in the directory version in the failover file system /postgres.
The PostgreSQL database cluster will be installed in the same file system as the database software, in the directory /postgres/data.
The home directory of the postgres user is /postgres.
The PostgreSQL build directory is in /tmp/postgres/version, and the software is already downloaded and extracted in this place.
# zlogin pgsql-zone
# groupadd -g 1000 postgres
# useradd -u 1000 -g postgres -d /postgres -m -s /usr/bin/ksh postgres
# su - postgres
$ PATH=$PATH:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin $ export PATH
$ LD_LIBRARY_PATH=/usr/sfw/lib:/usr/local/lib:/usr/lib: $ export LD_LIBRARY_PATH
$ cd /tmp/postgres/version
$ ./configure --prefix=/postgres/version
$ gmake $ gmake check $ gmake install
For a complete example of deploying in an HA container, see Appendix C, Deployment Example: Installing PostgreSQL in a Non-Global HA Container.
# clresourcetype register SUNW.HAStoragePlus SUNW.gds
# clresourcegroup create PostgreSQL-resource-group
# clresource create -t SUNW.HAStoragePlus \ -p FileSystemMountPoints=PostgreSQL-instance-mount-points \ PostgreSQL-has-resource
# clreslogicalhostname create -g PostgreSQL-resource-group \ PostgreSQL-logical-hostname-resource-name
# clresourcegroup online -M PostgreSQL-resource-group
Install the zone according to the Oracle Solaris Cluster HA for Solaris Containers agent documentation, assuming that the resource name is pgsql-zone-rs and that the zone name is pgsql-zone.
# zoneadm -z pgsql-zone boot # zoneadm -z pgsql-zone halt
# cp /opt/SUNWsczone/sczbt/util/sczbt_config zones-target-configuration-file
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=
# mkdir pgsql-zone-parameter-directory
# /opt/SUNWsczone/sczbt/util/sczbt_register -f zones-target-configuration-file
# clresource enable pgsql-zone-rs
# clresourcegroup online PostgreSQL-resource-group
For a complete example of deploying in an HA container, see Appendix C, Deployment Example: Installing PostgreSQL in a Non-Global HA Container.
Before You Begin
Determine the following requirements for the deployment of PostgreSQL with Oracle Solaris Cluster:
See if the PostgreSQL version that you need is already installed on each cluster node by searching the most probable root paths where you find bin/postmaster:
|
Determine the number of PostgreSQL resources to deploy.
Determine which cluster file systems will be used by each PostgreSQL resource.
Make sure that a C compiler, make, and the readline package are installed. These packages are needed to build PostgreSQL from the source code downloads from http://www.postgresql.org .
The following assumptions are made:
The zone postgres-zone is installed and configured on every node.
The compiler gcc and the gmake package are installed in /usr/sfw.
The readline package is installed under /usr/local.
The PostgreSQL database software will be installed on the shared storage, in the directory version in the failover file system /postgres.
The PostgreSQL database cluster will be installed in the same file system as the database software, in the directory /postgres/data.
The home directory of the postgres user is /postgres.
The PostgreSQL build directory is in /tmp/postgres/version, and the software is already downloaded and extracted in this place.
# zlogin postgres-zone
# groupadd -g 1000 postgres
# useradd -u 1000 -g postgres -d /postgres -m -s /usr/bin/ksh postgres
# su - postgres
$ PATH=$PATH:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin $ export PATH
$ LD_LIBRARY_PATH=/usr/sfw/lib:/usr/local/lib:/usr/lib: $ export LD_LIBRARY_PATH
$ cd /tmp/postgres/version
$ ./configure --prefix=/postgres/version
$ gmake $ gmake check $ gmake install