How to do it...

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

sudo apt-get install pgbouncer

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

sudo yum install pgbouncer

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

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

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.