# Tutorial: Building a Highly Available PostgreSQL Cluster with etcd, Patroni, HAProxy, and keepalived

DevFeed: [Tutorial: Building a Highly Available PostgreSQL Cluster with etcd, Patroni, HAProxy, and keepalived](<https://devfeed.tech/articles/postgressql-clustering-the-hard-way-10634.md>)

Original publisher: [Read original article](<https://technotim.com/posts/postgresql-high-availability/>)

Author: Techno Tim

Published: 2024-12-07T13:00:00Z

Content type: tutorial

Language: en

Sources: [Techno Tim](<https://devfeed.tech/sources/techno-tim.md>)

Topics: [postgresql clusters](<https://devfeed.tech/topics/postgresql-clusters.md>), [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Tutorial](<https://devfeed.tech/topics/tutorial.md>), [Database](<https://devfeed.tech/topics/database.md>)

Tags: [clustering](<https://devfeed.tech/tags/clustering.md>), [ha](<https://devfeed.tech/tags/ha.md>), [patroni](<https://devfeed.tech/tags/patroni.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [production](<https://devfeed.tech/tags/production.md>), [self-hosted](<https://devfeed.tech/tags/self-hosted.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>)

## AI overview

A tutorial for building a highly available and fault-tolerant PostgreSQL cluster with etcd, Patroni, HAProxy, and keepalived. It covers PostgreSQL node setup, certificate-based communication, etcd configuration, and cluster verification.

## Source excerpt

Today is the day that you start running PostgresSQL in a cluster! In this tutorial we'll be setting up a production ready Postgres cluster that's highly available and fault tolerant using PostgreSQL, etcd, Patroni, HA Proxy, and keepalived. This resilient combination will ensure that you can always reach your database even when a node in the cluster goes down! 📺 Watch Video Nodes # ha pr...