icon

PostgreSQL HA (developing)

High Availability PostgreSQL cluster with Patroni and etcd. Provides automatic failover and replication for production-grade database deployments.

template cover
部署次數4
發布者canyugs
建立於2025-11-13
模板內的服務
service icon
service icon
service icon
service icon
標籤
DatabasePostgreSQLHigh AvailabilityPatroni

PostgreSQL High Availability Cluster

This template deploys a highly available PostgreSQL cluster using:

  • Patroni: PostgreSQL HA solution with automatic failover
  • Spilo: Docker image combining PostgreSQL and Patroni
  • etcd: Distributed configuration and service discovery

Architecture

  • 1x etcd instance for distributed consensus
  • 3x PostgreSQL nodes with Patroni for automatic failover
  • Built-in replication and health monitoring

Connection Information

Use any of the Patroni nodes to connect to the cluster:

  • Host: Use the hostname of patroni1, patroni2, or patroni3
  • Port: 5432
  • Username: postgres (superuser) or admin
  • Password: Check the environment variables in Zeabur dashboard

Patroni will automatically route connections to the master node.

Features

  • Automatic Failover: If the master fails, Patroni automatically promotes a replica
  • Synchronous Replication: Data consistency across nodes
  • Health Monitoring: REST API on port 8008 for each node
  • Rolling Updates: Update nodes without downtime

Management

Access Patroni REST API for cluster status:

  • http://patroni1:8008/
  • http://patroni2:8008/
  • http://patroni3:8008/

Documentation