Patroni: Watchdog usage limits

Created on 2 Oct 2019  路  2Comments  路  Source: zalando/patroni

Hi,

I am trying to setup my patroni / etcd / watchdog cluster on a minimal config and I am having some issues :

  • I have to modprobe soft && chmod postgres /dev/watchdog, but should watchdog service run _before_ I start patroni or should patroni just handles it completely ? When watchdog service is stopped before starting patroni, patroni logs tells everything is ok but I can't see any actual effect

  • How can I custom watchdog with patroni ? For example, is it currently possible to make it apply watchdog configuration /etc/watchdog.conf ?

  • If it's not using /etc/watchdog.conf, is it possible to configure watchdog as verbose in patroni.yml ? Maybe configure repair-binary ?

Thank you

Most helpful comment

There is some confusion here as everything reuses the same name. /etc/watchdog.conf and the watchdog service is used by the program called watchdog. Patroni watchdog support uses the kernel watchdog interface directly and as such is mutually exclusive with the watchdog program. Supporting an external watchdog agent is a separate feature and would require significantly higher safety margins as the watchdog updates can't be synchronized with leader election and postgresql status update events.

If you just want watchdog for split brain protection, there is an example systemd service here: https://github.com/cybertec-postgresql/patroni-packaging/blob/master/RPM/patroni-watchdog.service Enabling this service will make sure Patroni has access to the watchdog device before it starts, which is enough for it to be enabled in the default config.

All 2 comments

There is some confusion here as everything reuses the same name. /etc/watchdog.conf and the watchdog service is used by the program called watchdog. Patroni watchdog support uses the kernel watchdog interface directly and as such is mutually exclusive with the watchdog program. Supporting an external watchdog agent is a separate feature and would require significantly higher safety margins as the watchdog updates can't be synchronized with leader election and postgresql status update events.

If you just want watchdog for split brain protection, there is an example systemd service here: https://github.com/cybertec-postgresql/patroni-packaging/blob/master/RPM/patroni-watchdog.service Enabling this service will make sure Patroni has access to the watchdog device before it starts, which is enough for it to be enabled in the default config.

Thank you very much

I think it would deserve a place in https://github.com/zalando/patroni/blob/master/docs/watchdog.rst
With an approximate knowledge on this, it is very hard to really have an answer as there is so much confusion between python watchdog, kernel watchdog, service watchdog...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vitabaks picture vitabaks  路  7Comments

alexeyklyukin picture alexeyklyukin  路  3Comments

oleg9301 picture oleg9301  路  8Comments

biarocha picture biarocha  路  9Comments

zetab picture zetab  路  3Comments