PATRONI
24 pagesPatroni 4.1.5 Documentation
Warning Running Patroni on memory-restricted systems with Python 3.11+ If you run Patroni on a system with strict memory limits, for example with vm.overcommit_memory=2 (recommended for PostgreSQL), and use Python 3.11 or newer, you may observe …
Warning Running Patroni on memory-restricted systems with Python 3.11+ If you run Patroni on a system with strict memory limits, for example with vm.overcommit_memory=2 (recommended for PostgreSQL), and use Python 3.11 or newer, you may observe …
Contributing guidelines
Chatting If you have a question, looking for an interactive troubleshooting help or want to chat with other Patroni users, join us on channel #patroni in the PostgreSQL Slack. Reporting bugs Before reporting a bug please make sure to reproduce it …
Chatting If you have a question, looking for an interactive troubleshooting help or want to chat with other Patroni users, join us on channel #patroni in the PostgreSQL Slack. Reporting bugs Before reporting a bug please make sure to reproduce it …
Release notes
Version 4.1.5 Released 2026-08-12 Compatibility improvements Compatibility with PostgreSQL 14.24, 15.19, 16.15, 17.11, 18.6 (Alexander Kukushkin) Add the new output_plugin_libraries GUC, which restricts logical decoding output plugins. Improvements …
Version 4.1.5 Released 2026-08-12 Compatibility improvements Compatibility with PostgreSQL 14.24, 15.19, 16.15, 17.11, 18.6 (Alexander Kukushkin) Add the new output_plugin_libraries GUC, which restricts logical decoding output plugins. Improvements …
FAQ
In this section you will find answers for the most frequently asked questions about Patroni. Each sub-section attempts to focus on different kinds of questions. We hope that this helps you to clarify most of your questions. If you still have further …
In this section you will find answers for the most frequently asked questions about Patroni. Each sub-section attempts to focus on different kinds of questions. We hope that this helps you to clarify most of your questions. If you still have further …
HA multi datacenter
The high availability of a PostgreSQL cluster deployed in multiple data centers is based on replication, which can be synchronous or asynchronous (see replication modes). In both cases, it is important to be clear about the following concepts: …
The high availability of a PostgreSQL cluster deployed in multiple data centers is based on replication, which can be synchronous or asynchronous (see replication modes). In both cases, it is important to be clear about the following concepts: …
Security Considerations
A Patroni cluster has two interfaces to be protected from unauthorized access: the distributed configuration storage (DCS) and the Patroni REST API. Protecting DCS Patroni and patronictl both store and retrieve data to/from the DCS. Even when the …
A Patroni cluster has two interfaces to be protected from unauthorized access: the distributed configuration storage (DCS) and the Patroni REST API. Protecting DCS Patroni and patronictl both store and retrieve data to/from the DCS. Even when the …
Integration with other tools
Patroni is able to integrate with other tools in your stack. In this section you will find a list of examples, which although not an exhaustive list, might provide you with ideas on how Patroni can integrate with other tools. Barman Patroni delivers …
Patroni is able to integrate with other tools in your stack. In this section you will find a list of examples, which although not an exhaustive list, might provide you with ideas on how Patroni can integrate with other tools. Barman Patroni delivers …
Convert a Standalone to a Patroni Cluster
This section describes the process for converting a standalone PostgreSQL instance into a Patroni cluster. To deploy a Patroni cluster without using a pre-existing PostgreSQL instance, see Running and Configuring instead. Procedure You can find …
This section describes the process for converting a standalone PostgreSQL instance into a Patroni cluster. To deploy a Patroni cluster without using a pre-existing PostgreSQL instance, see Running and Configuring instead. Procedure You can find …
Citus support
Patroni makes it extremely simple to deploy Multi-Node Citus clusters. TL;DR There are only a few simple rules you need to follow: Citus database extension to PostgreSQL must be available on all nodes. Absolute minimum supported Citus version is …
Patroni makes it extremely simple to deploy Multi-Node Citus clusters. TL;DR There are only a few simple rules you need to follow: Citus database extension to PostgreSQL must be available on all nodes. Absolute minimum supported Citus version is …
Using Patroni with Kubernetes
Patroni can use Kubernetes objects in order to store the state of the cluster and manage the leader key. That makes it capable of operating Postgres in Kubernetes environment without any consistency store, namely, one doesn’t need to run an extra …
Patroni can use Kubernetes objects in order to store the state of the cluster and manage the leader key. That makes it capable of operating Postgres in Kubernetes environment without any consistency store, namely, one doesn’t need to run an extra …
DCS Failsafe Mode
The problem Patroni is heavily relying on Distributed Configuration Store (DCS) to solve the task of leader elections and detect network partitioning. That is, the node is allowed to run Postgres as the primary only if it can update the leader lock …
The problem Patroni is heavily relying on Distributed Configuration Store (DCS) to solve the task of leader elections and detect network partitioning. That is, the node is allowed to run Postgres as the primary only if it can update the leader lock …
Pause/Resume mode for the cluster
The goal Under certain circumstances Patroni needs to temporarily step down from managing the cluster, while still retaining the cluster state in DCS. Possible use cases are uncommon activities on the cluster, such as major version upgrades or …
The goal Under certain circumstances Patroni needs to temporarily step down from managing the cluster, while still retaining the cluster state in DCS. Possible use cases are uncommon activities on the cluster, such as major version upgrades or …
Watchdog support
Having multiple PostgreSQL servers running as primary can result in transactions lost due to diverging timelines. This situation is also called a split-brain problem. To avoid split-brain Patroni needs to ensure PostgreSQL will not accept any …
Having multiple PostgreSQL servers running as primary can result in transactions lost due to diverging timelines. This situation is also called a split-brain problem. To avoid split-brain Patroni needs to ensure PostgreSQL will not accept any …
Standby cluster
Patroni also supports running cascading replication to a remote datacenter (region) using a feature that is called “standby cluster”. This type of clusters has: “standby leader”, that behaves pretty much like a regular cluster leader, except it …
Patroni also supports running cascading replication to a remote datacenter (region) using a feature that is called “standby cluster”. This type of clusters has: “standby leader”, that behaves pretty much like a regular cluster leader, except it …
Replication modes
Patroni uses PostgreSQL streaming replication. For more information about streaming replication, see the Postgres documentation. By default Patroni configures PostgreSQL for asynchronous replication. Choosing your replication schema is dependent on …
Patroni uses PostgreSQL streaming replication. For more information about streaming replication, see the Postgres documentation. By default Patroni configures PostgreSQL for asynchronous replication. Choosing your replication schema is dependent on …
Replica imaging and bootstrap
Patroni allows customizing creation of a new replica. It also supports defining what happens when the new empty cluster is being bootstrapped. The distinction between two is well defined: Patroni creates replicas only if the initialize key is …
Patroni allows customizing creation of a new replica. It also supports defining what happens when the new empty cluster is being bootstrapped. The distinction between two is well defined: Patroni creates replicas only if the initialize key is …
patronictl
Patroni has a command-line interface named patronictl, which is used basically to interact with Patroni’s REST API and with the DCS. It is intended to make it easier to perform operations in the cluster, and can easily be used by humans or scripts. …
Patroni has a command-line interface named patronictl, which is used basically to interact with Patroni’s REST API and with the DCS. It is intended to make it easier to perform operations in the cluster, and can easily be used by humans or scripts. …
Patroni REST API
Patroni has a rich REST API, which is used by Patroni itself during the leader race, by the patronictl tool in order to perform failovers/switchovers/reinitialize/restarts/reloads, by HAProxy or any other kind of load balancer to perform HTTP health …
Patroni has a rich REST API, which is used by Patroni itself during the leader race, by the patronictl tool in order to perform failovers/switchovers/reinitialize/restarts/reloads, by HAProxy or any other kind of load balancer to perform HTTP health …
Patroni configuration
There are 3 types of Patroni configuration: Global dynamic configuration. These options are stored in the DCS (Distributed Configuration Store) and applied on all cluster nodes. Dynamic configuration can be set at any time using …
There are 3 types of Patroni configuration: Global dynamic configuration. These options are stored in the DCS (Distributed Configuration Store) and applied on all cluster nodes. Dynamic configuration can be set at any time using …
Environment Configuration Settings
It is possible to override some of the configuration parameters defined in the Patroni configuration file using the system environment variables. This document lists all environment variables handled by Patroni. The values set via those variables …
It is possible to override some of the configuration parameters defined in the Patroni configuration file using the system environment variables. This document lists all environment variables handled by Patroni. The values set via those variables …
Installation
Pre-requirements for Mac OS To install requirements on a Mac, run the following: brew install postgresql etcd haproxy libyaml python Psycopg Starting from psycopg2-2.8 the binary version of psycopg2 will no longer be installed by default. Installing …
Pre-requirements for Mac OS To install requirements on a Mac, run the following: brew install postgresql etcd haproxy libyaml python Psycopg Starting from psycopg2-2.8 the binary version of psycopg2 will no longer be installed by default. Installing …
YAML Configuration Settings
Global/Universal thread_pool_size: size of thread pool used by Patroni to execute asynchronous tasks and communicate via REST API with other members during leader race or failsafe checks. Minimal value is 5, default value is 5. thread_stack_size: …
Global/Universal thread_pool_size: size of thread pool used by Patroni to execute asynchronous tasks and communicate via REST API with other members during leader race or failsafe checks. Minimal value is 5, default value is 5. thread_stack_size: …
Introduction
Patroni is a template for high availability (HA) PostgreSQL solutions using Python. Patroni originated as a fork of Governor, the project from Compose. It includes plenty of new features. For additional background info, see: PostgreSQL HA with …
Patroni is a template for high availability (HA) PostgreSQL solutions using Python. Patroni originated as a fork of Governor, the project from Compose. It includes plenty of new features. For additional background info, see: PostgreSQL HA with …
Dynamic Configuration Settings
Dynamic configuration is stored in the DCS (Distributed Configuration Store) and applied on all cluster nodes. In order to change the dynamic configuration you can use either patronictl_edit_config tool or Patroni REST API. loop_wait: the number of …
Dynamic configuration is stored in the DCS (Distributed Configuration Store) and applied on all cluster nodes. In order to change the dynamic configuration you can use either patronictl_edit_config tool or Patroni REST API. loop_wait: the number of …