Go to main content

Oracle® Solaris Cluster Data Service for PostgreSQL Guide

Exit Print View

Updated: June 2017
 
 

How to Install and Configure PostgreSQL in the Global Zone


Note -  For complete information about installing PostgreSQL, go to http://www.postgresql.org.

For a complete example of deployment in the global zone, see Deployment Example: Installing PostgreSQL in the Global Zone or a Zone Cluster.

Before You Begin

Determine the following requirements for the deployment of PostgreSQL with Oracle Solaris Cluster software:

  • See whether the PostgreSQL version that you need is already installed on each cluster node by searching the most probable root paths to find bin/postmaster:

    /usr

    Root path for PostgreSQL shipped with Oracle Solaris software.

    /usr/local/psql

    Root path for the PostgreSQL build without a prefix.

    /your-path

    Fully customized root path for PostgreSQL. This is where to place the binaries on the shared storage. A known convention is /path/postgresql-x.y.z.

  • 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.

  1. As the root role, create the home directory for the PostgreSQL user on one node.
    # mkdir /global/postgres
  2. Add a group for PostgreSQL on every node.
    # groupadd -g 1000 postgres
  3. Add a user who owns the PostgreSQL installation on every node.
    # useradd -u 1000 -g postgres -d /global/postgres -s /usr/bin/ksh postgres
    # chown -R postgres:postgres /global/postgres
  4. Switch to the PostgreSQL user.
    # su - postgres
  5. Set your PATH variable.
    $ PATH=$PATH:/usr/local/bin:/usr/sfw/bin:/usr/ccs/bin
    $ export PATH
  6. Set your LD_LIBRARY_PATH variable.
    $ LD_LIBRARY_PATH=/usr/sfw/lib:/usr/local/lib:/usr/lib:
    $ export LD_LIBRARY_PATH
  7. Switch to your build directory.
    $ cd /tmp/postgres/version
  8. Configure the PostgreSQL build.
    $ ./configure --prefix=/global/postgres/version
  9. Complete, verify and install the build.
    $ gmake
    $ gmake check
    $ gmake install