Project

General

Profile

Actions

tickets #159267

open

Configure PostgreSQL / repmgr switchover

Added by crameleon 7 months ago. Updated about 13 hours ago.

Status:
Workable
Priority:
Normal
Assignee:
-
Category:
Core services and virtual infrastructure
Target version:
-
Start date:
2024-04-18
Due date:
% Done:

0%

Estimated time:

Description

Our primary/secondary PostgreSQL pair on mirrordb{1,2}.i.o.o is currently not capable of automatically switching the primary and secondary nodes. Even if the switch is performed manually, PgBouncer on hel{1,2} is still only connecting to mirrordb2.

This blocks us from performing maintenance on the database hosts without outage.

Automatic switchover between mirrordb1 and mirrordb2 must be implemented and hooked into the host= setting on PgBouncer.

There are some ideas:
https://2018.pgday.it/assets/PostgreSQL_High_Availability_using_repmgr_and_pgbouncer.pdf
https://blog.raveland.tech/post/postgresql_repmgr_pgbouncer_en/

Security considerations must be taken into account when granting SSH access between the four machines. All PostgreSQL and repmgr related commands should already be executable through the postgres user, for systemctl some NOPASSWD sudo rules will probably need to be added.

Actions #1

Updated by crameleon 7 months ago

  • Private changed from Yes to No
Actions #2

Updated by crameleon 7 months ago

  • Description updated (diff)
Actions #3

Updated by crameleon 7 months ago

  • Status changed from New to Workable
  • Assignee changed from opensuse-admin to crameleon
Actions #4

Updated by crameleon 3 months ago

  • Assignee deleted (crameleon)
Actions #5

Updated by crameleon about 13 hours ago

Consider switching from PgBouncer to https://agroal.github.io/pgagroal/ as it has command line switchover functionality and built in metrics.

Actions

Also available in: Atom PDF