Hi, I'm João Vanzuita, a Backend software developer.

PostgreSQL High Availability and automatic failover using repmgr

This tutorial provides a comprehensive guide for setting up a PostgreSQL high-availability cluster with automatic failover. It offers a hands-on approach that utilizes Docker containers, a subnet network, and the repmgr tool to help you establish a resilient database infrastructure.

The tutorial walks you through the steps of creating a three-server cluster with one primary server and two standby servers. The repmgr tool ensures that when the primary server fails, it will automatically elect a new primary server to keep the PostgreSQL cluster highly available and operational during failover scenarios.

You'll also learn how to prepare the servers by starting the Docker containers, installing PostgreSQL, repmgr, repmgrd, and setting up the primary and standby servers. The steps to register the primary server into the cluster and set up the secondary and tertiary servers are also included. Finally, you'll learn how to enable repmgrd for monitoring and failover handling, and simulate a primary server failure to see how the cluster recovers from the failure.

It's important to note that the configurations provided in this tutorial may not be suitable for a production environment. However, the tutorial is a great resource for anyone who wants to gain hands-on experience with PostgreSQL replica and failover.

Hands ons: https://github.com/converge/PostgreSQL-High-Availability-and-automatic-failover-using-repmgr/blob/main/docs/hands-on.md