Skip to content

High Availability PostgreSQL Cluster on Docker using Repmgr & Pgpool. Features manual failover/failback simulations via container stoppage and traffic stability stress testing.

Notifications You must be signed in to change notification settings

oujisan/pg-distributed-cluster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Distributed PostgreSQL Cluster

This repository implements a Distributed PostgreSQL Database architecture designed for High Availability (HA) and resilience, fully orchestrated within Docker.

The core objective of this project is to validate how a distributed system handles critical failures. Instead of theoretical setups, I focused on Resilience Testing by:

  1. Manual Failure Simulation: Forcibly stopping Docker containers (Master/Slave nodes) to trigger real-time Failover and Failback events via repmgr.
  2. Traffic Stability Analysis: Running concurrent stress tests during these outages to verify that Pgpool-II successfully reroutes queries and maintains service availability with minimal downtime.
  3. Observability: Utilizing a full monitoring stack (Prometheus, Grafana, Postgres Exporter) to visually track replication lag and cluster health during the chaos.

Setup

  1. Run the containers
docker compse up -d
  1. Open your grafana at http://localhost:3000 and login with password in docker-compose.yml
  2. From dashboard, open menu -> Connections -> Data Sources
  3. Set Connection to http://prometheus:9000 and click Save & Test
  4. Back to dashboard click new button -> import.
  5. at Grafana dashboard URL or ID set value 9628 (postgreSQL).
  6. Click load and the dashboard ready to use

About

High Availability PostgreSQL Cluster on Docker using Repmgr & Pgpool. Features manual failover/failback simulations via container stoppage and traffic stability stress testing.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages