pg_auto_failover icon indicating copy to clipboard operation
pg_auto_failover copied to clipboard

Add rules for the monitor to pg_hba.conf on the secondary

Open gfphoenix78 opened this issue 4 years ago • 1 comments

When we enable pg_auto_failover for an existing postgres cluster, the pg_hba.conf on standby hasn't the following 2 rules compared with that of the primary.

host(ssl) all "pgautofailover_monitor" _host_ trust # Auto-generated by pg_auto_failover
host(ssl) "postgres" _user_ _host_ trust # Auto-generated by pg_auto_failover

As a result, the health check connection for the secondary continuously generates FATAL message:

FATAL:  no pg_hba.conf entry for host "10.123.119.3", \
user "pgautofailover_monitor", database "postgres", SSL off

This patch adds the access rule for the monitor on secondary, so the health check connection will gracefully exit.

gfphoenix78 avatar Apr 20 '21 03:04 gfphoenix78

Sounds reasonable, I'll take some time to update the PR.

gfphoenix78 avatar Apr 21 '21 01:04 gfphoenix78