Re: Real application clustering in postgres.

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Virendra Kumar <viru_7683(at)yahoo(dot)com>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>, Daulat Ram <Daulat(dot)Ram(at)exponential(dot)com>
Subject: Re: Real application clustering in postgres.
Date: 2020-03-06 08:59:33
Message-ID: 8e9aacea5fe0462f041b368cc85edb745ed30176.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 2020-03-05 at 17:06 +0000, Virendra Kumar wrote:
> Failover is easy but failback is little bit tricky.
> I have implemented failback by doing following steps:
>
> 1. Start original primary which will be doing crash recovery. It should be designed in such a way that once it is up application should not start connecting to it otherwise there will be split brain
> and data-mistach between two instances. I implemented it by using a virtual IP mounting on server which is actual primary using keepalived.
> 2. Shutdown original primary and do a pg_rewind to make that as slave for new primary.
> 3. Once slave (original primary) is caught up with primary do failback
> 4. Repeat steps #1-#3 to make failed over instance slave again.

Or you use Patroni and simply say

patronictl.py switchover --candidate db2 --scheduled '2020-03-06 12:00:00' mycluster

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2020-03-06 09:25:31 Re: Real application clustering in postgres.
Previous Message Mark Haylock 2020-03-06 02:46:35 Re: What do null column values for pg_stat_progress_vacuum mean?