PostgreSQL High-Availability has been one of the most dominant topics in the field for a long time. While there are many different approaches out there, Patroni seems to have become one of the most dominant solutions currently in use out there. Many database clusters run on Linux. However, we have seen some demand for a Microsoft Windows-based solution as well. The Patroni Environment Setup provides high availability for Windows.

While installing Patroni on Linux has become pretty simple, it is still an issue on Microsoft operating systems. There are simply too many parts that have to be in place to run Patroni and many people have found it hard to deploy Patroni.

PES: Patroni Environment Setup

PES is a graphical installer for Patroni on Windows which makes it really easy to deploy Patroni High-Availability. It takes care of all relevant components including:

  • Python and Python libraries
  • etcd
  • Patroni
  • PostgreSQL
  • vip-manager

During the initialization step PES will try to find every instances already running over the network. Or the admin can skip this step and specify nodes and their roles manually.
Patroni Environment Setup - High Availability for Windows: Init

PES will stall what is already installed and what is not. All missing parts will be deployed with minimal effort.

Patroni Environment Setup - High Availability for Windows: Python

Simplified Patroni configuration

One of the key issues is to configure more than one server at a time. PES makes it easy to solve this problem. Simply start PES on all nodes – the installer will then search for other running installers on the network and automatically exchange information.

Patroni Environment Setup - High Availability for Windows: Nodes

This greatly reduces the chances of configuration mistakes. If you want to build a reliable cluster it is essential that the etcd and Patroni configuration is not just correct but also consistent. By automatically exchanging information the risk of failure is reduced significantly.

Automatic Patroni and service deployment

PES is automatically going to configure all relevant services for you. It will make sure that …

  • Patroni
  • etcd
  • vip-manager

… are automatically started after a Windows reboot. The cluster is therefore ready for production use within minutes.

PES performs all necessary steps to provide you with a turnkey solution for PostgreSQL High-Availability and fault tolerance on Windows.
Run

Clusters and IP management

A database cluster consists of more than one machine. How does the application, therefore, know who is the current leader and which ones happen to be the replicas? The easiest solution to the problem is the introduction of service IPs. The core idea is to ensure that there is simply one IP all applications can connect to. The cluster itself will make sure that the service IP always points to the right server.

Patroni vipmanager

The tool capable of doing that on Windows and Linux is CYBERTEC vipmanager.
It checks etcd to figure out who the current leader is and makes sure the desired IPs are removed from a failed master and bound to the current leader.

The configuration is simple and easy to understand.

Trying out PES

If you want to try out PES check out our GitHub repo or directly download our Windows installer (binary) here .

If you are looking for professional consulting services to setup PostgreSQL high-availability please check out our services.