Skip to content

ragnarok56/ha-pg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

patroni postgres test

amalgamation of a variety of example docker-compose deploys for local patroni testing:

for further reference:

what is happening?

diagram

  • the demo-app polls haproxy on port 5432 to check connectivity to the active/primary db
  • haproxy is configured to route requests to the 3 patroni instances, using the patroni managed rest api port 8008 to health check status. only the active/primary db will return a 2xx response and requests will route there.
  • patroni will sync with consul cluster and register/deregister themselves as needed to ensure only 1 node is tagged with master

what to expect

Run the following to launch the project

docker-compose up

Eventually, you will see output similar to:

startup

test failover

Kill the patroni-1 container to force a failover (assuming patroni-1 is the master/primary)

docker-compose stop patroni-1

shutdown_patroni_1

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published