How it works...

As with all good recipes, we begin with the primary ingredients. Projects written with Python commonly include a file named setup.py that manages installation-related activity. If we invoke that script with the install parameter, Patroni gets installed as a generally available system package with associated command-line tools. We're particularly interested in the patroni and patronictl utilities.

We're not particularly sure why this is the case, but many of the libraries installed by Patroni are only readable by the root user. In order to fix this, we start by setting the FIXDIR environment variable to the probable location of the libraries. Next we use chmod to make all of the files readable, and finish with a find command ...

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.