How to do it...

Assuming our database is located at /db/pgdata, follow all of these steps to enable and configure automatic and forced pgpool primary server migration:

  1. Copy the scripts from the pgpool_scripts directory of this book to the PostgreSQL cluster data directory.
  2. Execute this command as a root-level user to make them executable:
        chmod a+x /db/pgdata/pgpool_*
  1. Execute the following at the command line as a root-capable user:
        sudo sed -i "s/'DISALLOW/'ALLOW/" /etc/pgpool/pgpool.conf
  1. Execute these commands as a root-capable user to enable pgpool control operations, where pass is a password defined for pgpool administration:
        mv /etc/pgpool/pcp.conf.sample /etc/pgpool/pcp.conf echo postgres:$(pg_md5 pass) >> /etc/pgpool/pcp.conf ...

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.