patroni pg_hba.conf issue

1.1k Views Asked by At

I've added a new node to my patroni cluster, and have added, via patronictl, the ip address for replication.

This is my config file:

loop_wait: 10
maximum_lag_on_failover: 1048576
postgresql:
  parameters:
    checkpoint_timeout: 30
    hot_standby: 'on'
    max_replication_slots: 5
    max_wal_senders: 5
    wal_keep_segments: 8
    wal_level: replica
  pg_hba:
  - host all dba all md5
  - host replication repl 10.150.33.11/24 md5
  - host replication repl 10.150.33.12/24 md5
  - host replication repl 10.150.33.13/24 md5
  - host replication repl 10.150.33.112/24 md5
  - host pdns pdns 10.150.33.5/24 md5
  - host pdns pdns 10.150.33.6/24 md5
  - host pdns pdns 10.150.33.7/24 md5
  - host pdns pnds 10.150.33.10/24 md5
  - host template1 pdns 10.150.33.211/24 md5
  - host template1 pdns 10.150.33.212/24 md5
  - host pdns pdns 10.150.33.211/24 md5
  - host pdns pdns 10.150.33.212/24 md5
  - host all borg all trust
  use_pg_rewind: true
  use_slots: true
retry_timeout: 10
ttl: 30

In my log files, following via journalctl -feu patroni, I'm receiving the following:

May 30 10:15:23 nsdb112 patroni[9850]: 2022-05-30 10:15:23,544 INFO: no action. I am (nsdb112), a secondary, and following a leader (nsdb03)
May 30 10:15:33 nsdb112 patroni[9850]: 2022-05-30 10:15:33,525 INFO: Lock owner: nsdb03; I am nsdb112
May 30 10:15:33 nsdb112 patroni[9850]: 2022-05-30 10:15:33,526 INFO: Local timeline=843 lsn=1/DB2C8D88
May 30 10:15:33 nsdb112 patroni[9850]: 2022-05-30 10:15:33,529 ERROR: Exception when working with leader
May 30 10:15:33 nsdb112 patroni[9850]: Traceback (most recent call last):
May 30 10:15:33 nsdb112 patroni[9850]:   File "/usr/lib/python3/dist-packages/patroni/postgresql/rewind.py", line 60, in check_leader_is_not_in_recovery
May 30 10:15:33 nsdb112 patroni[9850]:     with get_connection_cursor(connect_timeout=3, options='-c statement_timeout=2000', **conn_kwargs) as cur:
May 30 10:15:33 nsdb112 patroni[9850]:   File "/usr/lib/python3.9/contextlib.py", line 119, in __enter__
May 30 10:15:33 nsdb112 patroni[9850]:     return next(self.gen)May 30 10:15:33 nsdb112 patroni[9850]:   File "/usr/lib/python3/dist-packages/patroni/postgresql/connection.py", line 44, in get_connection_cursor
May 30 10:15:33 nsdb112 patroni[9850]:     conn = psycopg.connect(**kwargs)
May 30 10:15:33 nsdb112 patroni[9850]:   File "/usr/lib/python3/dist-packages/psycopg2/__init__.py", line 127, in connectMay 30 10:15:33 nsdb112 patroni[9850]:     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
May 30 10:15:33 nsdb112 patroni[9850]: psycopg2.OperationalError: connection to server at "10.150.33.13", port 5432 failed: FATAL:  no pg_hba.conf entry for host "10.150.33.112", user "repl", database "postgres", no encryption

The system at 112 is a clone of the others, with the proper IP address, it's on MAC. I've even rebuilt from scratch and receive the same thing.

Ideas towards a solution are very welcome

0

There are 0 best solutions below