For those who seeks help in different areas of Software and Hardware platform

How To Create a Highly Available PostgreSQL Cluster using Patroni and HAProxy

This tutorial will take you through the steps to set up a highly available PostgreSQL cluster using Patroni and HAProxy on an Ubuntu or Debian server. If you wish to skip step by step guide, watch below video tutorial that will be sufficient if you are good enough to pick things up quickly.




Prerequisites

To follow the steps covered in this tutorial, you will need five (physical or virtual) machines installed with Ubuntu (18.04, 19.04, 19.10, 20.04 or Debian 9, 10) server having sudo non-root user privileges.

These are the machines we will use in this guide for our cluster setup. However, if you wish you can add up more or go with less, its completely up to your requirement.

HOSTNAMEIP ADDRESSPURPOSE
NODE1192.168.10.1Postgresql, Patroni
NODE2192.168.10.2Postgresql, Patroni
NODE3192.168.10.3Postgresql, Patroni
NODE4192.168.10.4etcd
NODE5192.168.10.5HAProxy

When you have prerequisites in place, please proceed to follow this steps by steps tutorial to set up PostgreSQL High Availability cluster in your environment.
Share: