How to do it...

To install in a Debian or Ubuntu-based system, execute this command:

sudo apt-get install pgpool2 postgresql-9.6-pgpool2

To install in a CentOS, Fedora, or other RHEL-based systems, execute this command:

sudo yum install pgpool-II-96

Otherwise, follow these steps to complete a full source-based installation:

  1. Use these commands to extract the pgpool source and enter the source directory:
        tar -xzf pgpool-II-3.5.4.tar.gz
        cd pgpool-II-3.5.4
  1. Next, build and install the actual software with these commands:
        ./configure --prefix=/usr --sysconfdir=/etc/pgpool/
        make
        sudo make install
  1. Create a location where pgpool can maintain activity logs with these commands:
        sudo mkdir /var/log/pgpool
        sudo chown postgres /var/log/pgpool ...

Get PostgreSQL High Availability Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.