pgbackrest with PAF(corosync and pacmaker)

From: Ajay Pratap <ajaypratap(at)ameyo(dot)com>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: pgbackrest with PAF(corosync and pacmaker)
Date: 2019-10-17 07:48:23
Message-ID: CABi=8qw8t4T2Gy0E6o34h=mkyQcQ-utZdQ=V+GwrGq6i7Bd=-w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

##Arch
OS: Centos 7
PostgreSQL 10
pgbackrest 2.18
PAF: two nodes(primary and secondary ) with corosync and pacemaker

##Query
I am using pacemaker and corosync to setup two nodes High availability
cluster for postgreSQL 10. In the scenario I want to setup timely backup
with pgbackrest.
Using the _backup from standby_ feature I could able to take backup from my
secondary postgres. But if secondary postgres is down, it does not take
backup from primary.

What I want?
I want to take backup from secondary postgres (--backup-standby), If
secondary is unavailable, take backup from primary postgres.
Or if Primary postgres goes down backup should still continues from
secondary (which would have been promoted to master now)

All backups are with remote repository
pgbackrest.conf for repo:

*[data]pg1-host=pgprimarypg1-path=/var/lib/pgsql/10/datapg2-host=pgsecpg2-path=/var/lib/pgsql/10/data[global]backup-standby=yprocess-max=3repo1-path=/var/lib/pgbackrestrepo1-retention-full=2start-fast=y*

pgbackrest for primary and secondary postgres:

*[data]pg1-host=mainpg1-path=/var/lib/pgsql/10/datapg2-host=secpg2-path=/var/lib/pgsql/10/data[global]backup-standby=nprocess-max=3repo1-path=/var/lib/pgbackrestrepo1-retention-full=2start-fast=y*

Is there any way to achieve this?
This sounds like a generic problem? Or am I doing something wrong

Regards,
ajay

--

*Disclaimer:* The information in this communication is confidential and
may be legally privileged. It is intended solely for the use of the
individual or entity to whom it is addressed and others authorized to
receive it. If you are not the intended recipient you are hereby notified
that any disclosure, copying, distribution or taking action in reliance of
the contents of this information is strictly prohibited and may be
unlawful. Drishti is neither liable for the improper, incomplete
transmission of the information contained in this communication nor any
delay in its receipt. The communication is not intended to operate as an
electronic signature under any applicable law. Drishti assumes no
responsibility for any loss or damage resulting from the use of e-mails.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2019-10-17 08:33:58 Re: Has there been any discussion of custom dictionaries being defined in the database?
Previous Message Ajay Pratap 2019-10-17 07:22:59 Re: Pgbackrest backup is too slow