3 ms·
Doesn't HAProxy provide such functionality? Patroni has REST API which can be used by HAProxy for a health-check. patroni:8008/master will return http status c
by CyberDem0n 9y ago
Doesn't HAProxy provide such functionality?
Patroni has REST API which can be used by HAProxy for a health-check.
patroni:8008/master will return http status code 200 only if the node running as elected master
patroni:8008/replica will return http status code 200 if node running as replica.
And final missing bit is a automation of generation of haproxy.cfg - it could be done with confd: https://github.com/kelseyhightower/confd https://github.com/kelseyhightower/confd
And here is an example of template file: https://github.com/zalando/patroni/blob/master/extras/confd/templates/haproxy.tmpl https://github.com/zalando/patroni/blob/master/extras/confd/...
- vishesh92 9y agoI am not sure, will HAProxy forcibly close connections to old master in case of a failover?
- CyberDem0n 9y agoon-marked-down shutdown-sessions should do the trick
- deleted 9y ago[deleted]