Managing PostgreSQL clusters with Patroni
Alexey started with PostgreSQL at 2003 as a C programmer. He learned how to debug the backend code before learning SQL, but caught up on the latter pretty quickly. He is now using both of those skills and years of experience as a database consultant to help his employer manage a growing number of PostgreSQL database clusters and deal with hundreds of database changes during weekly deployments. A native of Simferopol, Ukraine, he lives in Berlin and works as a Database Engineer at Zalando SE. Over the years, he contributed code and documentation to the PostgreSQL project.
Alexander is a Database Engineer at Zalando, with many years of experience working with PostgreSQL. He is the most active contributor to the Patroni project. Occasionally he finds issues in well-known open-source projects (PostgreSQL, pgbouncer) and contributes patches.
No video of the event yet, sorry!
PostgreSQL has built-in support for creating hot standby nodes and keeping them up-to-date with streaming replication; alas, there is no out-of-box failover. Patroni is a small Python daemon to fill that niche, enabling anyone in a few simple steps to create high availability PostgreSQL clusters based on hot standby and streaming replication. It manages the PostgreSQL database instance and utilises an external consistency layer (based on either Etcd, Consul, Zookeeper or Kubernetes) for cluster-wide information, such as the list of members and the leader key. Patroni supports on-the-fly addition of new replicas to the existing cluster, can dynamically change the PostgreSQL configuration on all cluster nodes at once, implements both automatic failovers and controlled switchovers (both immediate and scheduled ones). It provides a lot of useful features, such as support for synchronous replication, custom actions fired during the leader switch, reporting and managing of the state of the instance via the REST API, running user-supplied scripts for replica imaging and custom bootstrap of the first node in the cluster, Kubernetes-native mode and much more. We'll go through the architecture of Patroni, provide in-detailed instructions how to configure HA PostgreSQL clusters based on it and describe many additional features. Participants will get hands-on experience in setting up HA PostgreSQL, diagnosing and troubleshooting most common issues happening during that process. We expect to cover the following topics:
- architecture overview
- hands-on: creating your first HA cluster
- using patronictl to change the PostgreSQL configuration dynamically
- REST API-based monitoring
- approaches to forwarding clients to the master node
- additional features: switchovers, scheduled actions, pause mode
- setting up synchronous replication
- using tags for cascading replication and bootstrapping from replicas
- extending Patroni with custom scripts
- diagnosing and troubleshooting common errors
- 2018 April 16 13:00
- 3 h
- Liberty I
- PostgresConf US 2018
- Operations and Administration
- Requires Registration:
- Yes (Registered: 19/35)