pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Virendra Kumar <viru_7683@yahoo.com>
To: Laurenz Albe <laurenz.albe@cybertec.at>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
To: Daulat Ram <Daulat.Ram@exponential.com>
Subject: Re: Real application clustering in postgres.
Date: Thu, 5 Mar 2020 17:06:17 +0000 (UTC)
Message-ID: <1087099197.4979138.1583427977985@mail.yahoo.com> (raw)
In-Reply-To: <BY5PR01MB5843F875A8C39542862253F99BE20@BY5PR01MB5843.prod.exchangelabs.com>
References: <BY5PR01MB58436F3E3FCE8FD0CF73A29F9BE20@BY5PR01MB5843.prod.exchangelabs.com>
	<1aa5a345543ea85b3e0e7d3021ed6b1cdc04e66c.camel@cybertec.at>
	<BY5PR01MB5843F875A8C39542862253F99BE20@BY5PR01MB5843.prod.exchangelabs.com>

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 failback4. Repeat steps #1-#3 to make failed over instance slave again.

Regards,Virendra
 

    On Thursday, March 5, 2020, 8:48:54 AM PST, Daulat Ram <daulat.ram@exponential.com> wrote:  
 
 Thanks for your inputs Laurenz Albe.

Would you please explain single-master failover solution.

Suppose we have promoted  standby (replica) as master after the h/w issue at Master. 
If after few hours we recovered  the h/w then how we can switchback on the old primary. . 

As in Oracle we have switchover method for Dataguard. How we can do in Postgres.

Thanks,

-----Original Message-----
From: Laurenz Albe <laurenz.albe@cybertec.at> 
Sent: Thursday, March 5, 2020 5:37 PM
To: Daulat Ram <Daulat.Ram@exponential.com>; pgsql-general@lists.postgresql.org
Subject: Re: Real application clustering in postgres.

On Thu, 2020-03-05 at 07:45 +0000, Daulat Ram wrote:
> Is there any possibility/options to setup a real application clustering in Postgres as in Oracle we have a  RAC feature.

No, and as far as I know nobody feels interested in providing it.

RAC is a complicated architecture that doesn't do much good, so most people feel that it would be a waste of time and effort.

RAC ist not really a scaling solution: because of the shared storage, you can only scale for more CPUs; I/O remains the bottleneck.

RAC is not really a high availability solution: because of the shared storage, it has a sibgle point of failure.

Today, people use shared-nothing architectures for high avaliability, like Patroni.

> What about multi-master replication in Postgres. would you please suggest how it is useful and how can setup it.

There is no support for that in core PostgreSQL.

There is a closed-source implementation that you can buy:
https://www.2ndquadrant.com/en/resources/postgres-bdr-2ndquadrant/

But multi-master replication is complicated to get right, and an applicatoin that uses it has to be specifically designed for that.
Very often a single-master failover solution is a better solution.

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

  

view thread (17+ messages)  latest in thread

Message-ID: <1087099197.4979138.1583427977985@mail.yahoo.com>
Permalink:  ../1087099197.4979138.1583427977985@mail.yahoo.com/
Also on:    postgresql.org/message-id/1087099197.4979138.1583427977985@mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: viru_7683@yahoo.com, laurenz.albe@cybertec.at, Daulat.Ram@exponential.com
  Subject: Re: Real application clustering in postgres.
  In-Reply-To: <1087099197.4979138.1583427977985@mail.yahoo.com>
  References: <BY5PR01MB58436F3E3FCE8FD0CF73A29F9BE20@BY5PR01MB5843.prod.exchangelabs.com> <1aa5a345543ea85b3e0e7d3021ed6b1cdc04e66c.camel@cybertec.at> <BY5PR01MB5843F875A8C39542862253F99BE20@BY5PR01MB5843.prod.exchangelabs.com> <1087099197.4979138.1583427977985@mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox