{"id":27231299,"url":"https://github.com/vtomasr5/postgresql-patroni-setup","last_synced_at":"2026-02-21T04:33:46.694Z","repository":{"id":140828195,"uuid":"160710738","full_name":"vtomasr5/postgresql-patroni-setup","owner":"vtomasr5","description":"PostgreSQL playground setup with patroni","archived":false,"fork":false,"pushed_at":"2020-06-05T17:19:09.000Z","size":75,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-23T22:48:57.729Z","etag":null,"topics":["patroni","pgbouncer","postgresql","vagrant"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vtomasr5.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-06T17:47:11.000Z","updated_at":"2020-06-05T17:19:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"7640b7b1-41ce-45fb-982d-b35c1cc5c22d","html_url":"https://github.com/vtomasr5/postgresql-patroni-setup","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vtomasr5/postgresql-patroni-setup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vtomasr5%2Fpostgresql-patroni-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vtomasr5%2Fpostgresql-patroni-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vtomasr5%2Fpostgresql-patroni-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vtomasr5%2Fpostgresql-patroni-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vtomasr5","download_url":"https://codeload.github.com/vtomasr5/postgresql-patroni-setup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vtomasr5%2Fpostgresql-patroni-setup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29673785,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T03:11:15.450Z","status":"ssl_error","status_checked_at":"2026-02-21T03:10:34.920Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["patroni","pgbouncer","postgresql","vagrant"],"created_at":"2025-04-10T13:44:17.376Z","updated_at":"2026-02-21T04:33:46.636Z","avatar_url":"https://github.com/vtomasr5.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"postgresql-patroni-setup\n========================\n\n# Overview\n\nThis repo it helps you quickly spin up a 3-node cluster of PostgreSQL, managed by Patroni using Consul.\n\n# What's in the cluster?\n\nWhen you start the cluster, you get 2 nodes (pg01 and pg02), each running:\n\n  - PostgreSQL\n  - Patroni\n  - Consul agent\n\nand a third node (pg03) running:\n\n  - Consul (server)\n  - HAProxy\n  - pgBouncer\n\nThe connection/data path is the following:\n\n1. pgBouncer (where the app will connect)\n2. HAProxy\n3. PostgreSQL\n\nAll packages are from Ubuntu 16.04, except for PostgreSQL itself, which is at version 12.x.\n\nThe cluster is configured with a single primary and one asynchronous streaming replica.\n\n# Dependencies\n1. [Virtualbox](https://www.virtualbox.org/wiki/Downloads)\n2. [Vagrant](http://www.vagrantup.com/downloads.html)\n3. `git clone https://github.com/vtomasr5/postgresql-patroni-setup.git`\n\n# Getting started\n\n1.  On 3 separate windows:\n2.  `vagrant up pg03 \u0026\u0026 vagrant ssh pg03 # pg03 contains the consul server and it must start first` \n3.  `vagrant up pg01 \u0026\u0026 vagrant ssh pg01`\n4.  `vagrant up pg02 \u0026\u0026 vagrant ssh pg02`\n\n# Viewing cluster status\n\nGet patroni information from his members\n  - `patronictl -c /etc/patroni/patroni.yml list`\n\n# Connecting to PostgreSQL\n\nYou should use the pgBouncer connection pool\n  - 172.28.33.13:6432\n\nBut you can also connect via HAproxy using the balancing IP\n  - 172.28.33.13:5000 (postgresql)\n  - 172.28.33.13:7000 (HAProxy stats)\n\n# TODO\n\n- [X] Add pgBouncer support\n- [X] Test on a Windows host (tested on Linux and macOS hosts)\n- [ ] Improve documentation\n\n# I have a question!\n\nWe're happy to receive questions as issues on this repo, so don't be shy!\n\nIt's hard to know exactly what documentation/guidance is useful to people, so we'll use the questions we answer to improve this README and link out to more places you can read up on the technologies we're using.\n\n# Further reading\n\n* [PostgreSQL and Patroni cluster](https://www.linode.com/docs/databases/postgresql/create-a-highly-available-postgresql-cluster-using-patroni-and-haproxy/#before-you-begin)\n\n# References\n* [PostgreSQL](https://www.postgresql.org)\n* [Patroni](https://patroni.readthedocs.io/en/latest/)\n* [HAProxy](https://www.haproxy.org/)\n* [Vagrant](http://vagrantup.com)\n* [VirtualBox](http://www.virtualbox.org)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvtomasr5%2Fpostgresql-patroni-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvtomasr5%2Fpostgresql-patroni-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvtomasr5%2Fpostgresql-patroni-setup/lists"}