How to do it...

For this recipe, we will need at least three PostgreSQL servers. As before, we'll assume they are named pg1, pg2, and pg3. Follow these steps on all three servers except where indicated:

  1. Extract and install Patroni by running the following commands as a root-capable user:
        tar -xzf v1.1.tar.gz
        cd patroni-1.1
        sudo python setup.py install
  1. Continue by fixing any adversely affected Python libraries with this set of commands:
        export FIXDIR=$(python -c \
              'import site; print(site.getsitepackages()[0])')
        sudo chmod -R a+r $FIXDIR
        sudo find $FIXDIR -type d -exec chmod a+x {} \;
  1. Execute this command to find where the PostgreSQL binaries are stored:
        pg_config --bindir
  1. Now create a configuration directory for Patroni that ...

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.