HTTP daemon to check postgresql server status for haproxy
This repository implements a permanent HTTP daemon to monitor postgresql database state and to decide which server in configuration is active master.
Response from tool is used by haproxy to redirect traffic to writable postgres master server, to readonly slave servers and to detect unavailable postgres servers.
Configuration files
Configuration path is ~/.config/pgstatus.conf. Configuration file is required if you want to monitor a postgres server that is not localhost:5432 as user postgres and not using postgres as database to check.
See example configuration file in examples directory.
See example configuration for haproxy in examples/haproxy.conf.
Running the service
There is example systemd service unit available in examples/pgstatus-daemon.service, configured by default to run as postgres user (so normally no user and password needs to be configured for default postgres).
To install:
cp examples/pgstatus-daemon.service /etc/systemd/system/ systemctl daemon-reload systemctl enable pgstatus-daemon systemctl start pgstatus-daemon
Credits
The basic idea is based on website
https://severalnines.com/blog/postgresql-load-balancing-using-haproxy-keepalived
Instead of xinetd and shell script, this implements the check as a systemd controlled permanent daemon.
Metadata
Release files for pgstatus 1.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pgstatus-1.1.3.tar.gz | 3.9 kB | Without provenance | Details for pgstatus-1.1.3.tar.gz |
Release files / pgstatus-1.1.3.tar.gz
| Download URL | pgstatus-1.1.3.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7adb3c5ed4e7b3004755b4e4e5f7ab3e3cdfb39b523f450d827797f3a52004d4
|
|
BLAKE2b-256 checksum How to use checksums |
095e641683b1526804645276cf23ec658ad19f0113558cbd9e1763c341dd08dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.7.2
|
Security for pgstatus 1.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.