Installing and Managing Extensions v1.0

Edit this page

Modules in the extensions directory are additional features to EDB Postgres Advanced Server, which are generally not included in the core database. Once loaded in a database, they can function just like built-in features. They allow you to use simple SELECT commands to use PCP remotely.

Note

Pgpool-II extensions are only delivered for supported combinations of EDB Postgres Advanced Server versions and operating systems.

Before installing Pgpool-II extensions, install the EDB Postgres Advanced Server on your host system. You can install the following Pgpool-specific extensions using the following command:

Installing Pgpool-II Extensions

The following section walks you through the steps of installing Pgpool-II extensions. To request credentials for the repository, visit the EDB website.

Installing Pgpool-II Extension on a CentOS Host

Assume superuser privileges and perform the following steps to install Pgpool-II extensions on a CentOS host:

  1. To install the repository configuration, assume superuser privileges and invoke one of the following platform-specific commands:

    On CentOS 7:

    yum -y install https://yum.enterprisedb.com/edbrepos/edb-repo-latest.noarch.rpm

    On CentOS 8:

    dnf -y install https://yum.enterprisedb.com/edbrepos/edb-repo-latest.noarch.rpm
  2. Replace the USERNAME:PASSWORD in the following command with the username and password of a registered EDB user:

    sed -i "s@<username>:<password>@USERNAME:PASSWORD@" /etc/yum.repos.d/edb.repo
  3. Before installing Pgpool, execute the following command to install the Extra Packages for Enterprise Linux (EPEL):

    On CentOS 7:

    yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

    On CentOS 8:

    dnf -y install epel-release
  4. For CentOS 8, enable the PowerTools repository to satisfy EPEL package dependencies:

    dnf config-manager --set-enabled PowerTools
  5. Use the platform-specific command to install Pgpool-II extensions:

    On RHEL/CentOS 7:

    yum -y install edb-as<xx>-pgpool<yy>-extensions

    For example, to install Pgpool42 extensions for EDB Postgres Advanced Server 13, execute the following command:

    yum -y install edb-as13-pgpool42-extensions

    On RHEL/CentOS 8:

    dnf install edb-as<xx>-pgpool<yy>-extensions

In the above command, <xx> is the EDB Postgres Advanced Server version, and <yy> is the Pgpool-II extension version. The extensions will be available in the /usr/edb/as<xx>/share/extension directory.

Installing Pgpool-II Extensions on an RHEL Host

Before installing the repository configuration, you must have credentials that allow access to the EDB repository. For information about requesting credentials, visit the EDB website.

Perform the following steps to install Pgpool-II extensions on an RHEL host:

  1. To install the repository configuration, assume superuser privileges and invoke one of the following platform-specific commands:

    On RHEL 7:

    yum -y install https://yum.enterprisedb.com/edbrepos/edb-repo-latest.noarch.rpm

    On RHEL 8:

    dnf -y install https://yum.enterprisedb.com/edbrepos/edb-repo-latest.noarch.rpm
  2. Replace the USERNAME:PASSWORD in the following command with the username and password of a registered EDB user:

    sed -i "s@<username>:<password>@USERNAME:PASSWORD@" /etc/yum.repos.d/edb.repo
  3. Before installing Pgpool, execute the following command to install the Extra Packages for Enterprise Linux (EPEL):

    On RHEL 7:

    yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

    On RHEL 8:

    dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
  4. Enable the repository:

    On RHEL 7, enable the optional, extras, and HA repositories to satisfy EPEL package dependencies:

    subscription-manager repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms"  --enable "rhel-ha-for-rhel-*-server-rpms"

    On RHEL 8, enable the codeready-builder-for-rhel-8-*-rpms repository to satisfy EPEL packages dependency:

    ARCH=$( /bin/arch )
    
    subscription-manager repos --enable "codeready-builder-for-rhel-8-${ARCH}-rpms"
  5. Use the platform-specific command to install Pgpool-II extensions:

    On RHEL/CentOS 7:

    yum -y install edb-as<xx>-pgpool<yy>-extensions

    For example, to install Pgpool42 extensions for EDB Postgres Advanced Server 13, execute the following command:

    yum -y install edb-as13-pgpool42-extensions

    On RHEL/CentOS 8:

    dnf install edb-as<xx>-pgpool<yy>-extensions

In the above command, <xx> is the EDB Postgres Advanced Server version, and <yy> is the Pgpool-II extension version. The extensions will be available in the /usr/edb/as<xx>/share/extension directory.

Installing Pgpool-II Extensions on an RHEL/CentOS 7 PPCLE Host

Before installing the repository configuration, you must have credentials that allow access to the EDB repository. For information about requesting credentials, visit the EDB website.

Perform the following steps to install Pgpool-II extensions on an RHEL/CentOS 7 PPC64LE Host:

  1. Install Advance Toolchain:

    rpm --import https://public.dhe.ibm.com/software/server/POWER/Linux/toolchain/at/redhat/RHEL7/gpg-pubkey-6976a827-5164221b
    
    cat > /etc/yum.repos.d/advance-toolchain.repo <<EOF
    
    # Beginning of the configuration file
    [advance-toolchain]
    name=Advance Toolchain IBM FTP
    baseurl=https://public.dhe.ibm.com/software/server/POWER/Linux/toolchain/at/redhat/RHEL7
    failovermethod=priority
    enabled=1
    gpgcheck=1
    gpgkey=ftp://public.dhe.ibm.com/software/server/POWER/Linux/toolchain/at/redhat/RHELX/gpg-pubkey-6976a827-5164221b
    # End of the configuration file
  2. To install the repository configuration, assume superuser privileges and invoke the following command:

    yum -y install https://yum.enterprisedb.com/edbrepos/edb-repo-latest.noarch.rpm
  3. Replace the USERNAME:PASSWORD in the following command with the username and password of a registered EDB user:

    sed -i "s@<username>:<password>@USERNAME:PASSWORD@" /etc/yum.repos.d/edb.repo
  4. Before installing Pgpool-II, execute the following command to install the Extra Packages for Enterprise Linux (EPEL):

    yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
  5. On RHEL 7, enable the optional, extras, and HA repositories to satisfy EPEL package dependencies:

    subscription-manager repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms"  --enable "rhel-ha-for-rhel-*-server-rpms"
  6. Invoke the following command to install Pgpool-II extensions:

    yum -y install edb-as13-pgpool<xx>-extensions

    Where <xx> is the Pgpool-II version you want to install.

Installing Pgpool-II Extensions on a Debian/Ubuntu Host

To install Pgpool-II extensions on a Debian or Ubuntu host, you must have credentials that allow access to the EDB repository. To request credentials for the repository, visit the EDB website.

The following steps walk you through using the EDB apt repository to install a DEB package. When using the commands, replace the username and password with the credentials provided by EDB.

Note

If you are using the pdf version of this document, using the cut/paste command may result in extra spaces or carriage returns in the pasted command. If a command fails, check the command carefully for additional characters.

  1. Assume superuser privileges:

    sudo su –
  2. Configure the EDB repository:

    On Debian 9 and Ubuntu 18:

    sh -c 'echo "deb https://username:password@apt.enterprisedb.com/$(lsb_release -cs)-edb/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/edb-$(lsb_release -cs).list'

    On Debian 10:

    a. Set up the EDB repository:

    sh -c 'echo "deb [arch=amd64] https://apt.enterprisedb.com/$(lsb_release -cs)-edb/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/edb-$(lsb_release -cs).list'

    b. Substitute your EDB credentials for the username and password placeholders in the following command:

    sh -c 'echo "machine apt.enterprisedb.com login <username> password <password>" > /etc/apt/auth.conf.d/edb.conf'
  3. Add support to your system for secure APT repositories:

    apt-get install apt-transport-https
  4. Add the EDB signing key:

    wget -q -O - https://apt.enterprisedb.com/edb-deb.gpg.key | apt-key add -
  5. Update the repository metadata:

    apt-get update
  6. Install the Debian package:

    apt-get install -y edb-as<xx>-pgpool<yy>-extensions

In the above command, <xx> is the EDB Postgres Advanced Server version, and <yy> is the Pgpool-II extension version you want to install.

Installing Pgpool-II Extension on a SLES 12 Host

You can use the Zypper package manager to install the Pgpool-II extension on a SLES 12 host. Zypper will attempt to satisfy package dependencies as it installs a package but requires access to specific repositories that are not hosted at EDB.

  1. Assume superuser privileges.

    sudo su -
  2. Use the following command to add the EDB repository to your SLES host:

    zypper addrepo https://zypp.enterprisedb.com/suse/edb-sles.repo
  3. Invoke the following command to refresh the metadata:

    zypper refresh
  4. Install SUSEConnect to register the host with SUSE to allow access to SUSE repositories:

    zypper install SUSEConnect
  5. Register the host with SUSE to allow access to SUSE repositories and replace 'REGISTRATION_CODE' and 'EMAIL' with your SUSE registration information:

    SUSEConnect -r 'REGISTRATION_CODE' -e 'EMAIL'
    SUSEConnect -p PackageHub/12.4/x86_64
    SUSEConnect -p sle-sdk/12.4/x86_64
  6. Install the following repository for PEM dependencies:

    zypper addrepo https://download.opensuse.org/repositories/Apache:/Modules/SLE_12_SP4/Apache:Modules.repo
  7. Refresh the metadata:

    zypper refresh
  8. Install OpenJDK (version 1.8) for Java based components:

    zypper -n install java-1_8_0-openjdk
  9. Then, use the Zypper utility to install Pgpool-II extension:

    zypper -n install edb-as<xx>-pgpool<yy>-extensions

    Where <xx> is the EDB Postgres Advanced Server version and <yy> is the Pgpool version you wish to install.

Installing Pgpool-II Extension Using Linux Installer

Graphical installers for Pgpool-II extensions are available via StackBuilder Plus (for EDB Postgres Advanced Server hosts) or Stack Builder (on PostgreSQL hosts). You can access StackBuilder Plus through your Linux start menu. Windows systems does not support it.

Perform the following steps to install Pgpool-II extensions:

  1. Open StackBuilder Plus and select your EDB Postgres Advanced Server installation from the drop-down list on the Welcome window. Click Next to continue to the application selection page. Expand the Add-ons, tools and utilities node, and check the box next to the Pgpool-II extension to select and download the installer. Click Next to continue. Provide the credentials and click Next.

  2. The selected packages and the default download directory where the package will be installed are displayed; change the download directory location if required. Click Next.

  3. Once you have downloaded the installation files, a confirmation message is displayed. Click Next to start the installation.

  4. Select an installation language and click OK.

  5. The Pgpool-II extensions installer welcomes you to the setup wizard.

    The Pgpool-II Extensions Welcome window

    Fig. 1: The Pgpool-II Extensions Welcome window

  6. Use the Installation Directory field to specify the directory in which you wish to install the Pgpool-II extensions software (the default installation directory is /opt/edb/as<xx>) Then, click Next to continue.

    The Pgpool-II Extensions Installation Details Window

    Fig. 2: The Pgpool-II Extensions Installation Details Window

  7. The Ready to Install window notifies you when the installer has all of the information needed to install Pgpool-II extensions on your system. Click Next to install Pgpool-II extensions.

    The Ready to Install window

    Fig. 3: The Ready to Install window

  8. Progress bars inform you as the installation progresses.

    The installation progresses

Fig. 4: The installation progresses

  1. The installer notifies you when the setup wizard has completed the Pgpool-II installation. Click Finish to exit the installer.

    The installation is complete

Fig. 5: The installation is complete

  1. The extensions will be available in the /opt/edb/as<xx>/share/extension/pgpool* directory.

Creating Pgpool-II Extensions

You must install and create the extensions in each database in which you will be using Pgpool-II functionality. To ensure all extensions are available for future databases, you can add the extension to the template1 database; any extensions installed in the template1 database will be created in each of the databases that uses template1 as a template during creation.

Pgpool_adm Extension

Pgpool_adm is a set of extensions that allows SQL access to PCP commands. To view information about PCP commands, see https://www.pgpool.net/docs/latest/en/html/pcp-commands.html.

After installing the Pgpool_adm extension, use the psql client application to connect to the database, and execute the following SQL command:

CREATE EXTENSION pgpool_adm;

To view more information about Pgpool_adm, see https://www.pgpool.net/docs/latest/en/html/pgpool-adm.html.

Pgpool_recovery Extension

The Pgpool_recovery extension is required for online recovery and future fail-back mechanisms.

After installing the Pgpool_recovery extension, use psql to connect to the database, and execute the following SQL command to create a Pgpool_recovery extension:

CREATE EXTENSION pgpool_recovery;

For more information about using the CREATE EXTENSION command, see the PostgreSQL core documentation.