Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1j9txD-0007pf-RI for pgsql-general@arkaria.postgresql.org; Thu, 05 Mar 2020 17:06:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j9txB-0004ad-HU for pgsql-general@arkaria.postgresql.org; Thu, 05 Mar 2020 17:06:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j9txA-0004Yd-G0 for pgsql-general@lists.postgresql.org; Thu, 05 Mar 2020 17:06:33 +0000 Received: from sonic309-21.consmr.mail.ne1.yahoo.com ([66.163.184.147]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j9tx3-0000rr-HG for pgsql-general@lists.postgresql.org; Thu, 05 Mar 2020 17:06:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1583427983; bh=aA3xK1IRbkNyHkt8NN4J6hIl4UINfYpOnylq5ynEFTo=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject; b=reT2A+AiT5wYTN0VNDlTH7mLZYNCpvaNtjDA8GFN1megLGcy7pXazHnj+0QcVi6KaFImiIoD2tl52ACLWWbw2C1J7k/tgGvLtE68cDdZdBiKdwLmlaJ4ccylWk5Q4yrDfu6Axoa3wE7jBtKFxDm9XF0gOmeOhatQ+niNIVrb8Kw/ssukY3ZV0cQbz0hlsZLQRl/ujHAjN81Tb5QPN2GL66tPN4mvNuw7s9KD89VlZahJrQDymFqMORV2obJWyuNU2/1jVXuVDYmBszOVzMvVe8ftGiUz3lLTaGoikPH5UiabgUhiK1EqY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BFjm7HCxwrI3.ZUS1tosrTYthKN.g RxicC0cnl1.1RbgB4lRNLH2bDerrLZiHrpNz3PfBSCkPE5C9oDgJlid36jnjWBnJbx.1z6gZm3TN ZVa1o4tN61bBL1NiBAoiFU1zJIq9YsWEFgruPlvol0RgrlcUtXUkABTvFW1blDTe_1cOIRkgC4B5 EDQm3HWc.Yu.1TcIm.y7swNcGSxfgsYXFTesgWCGFQ41zXC3JpsCs9YZ12tGxvDtJM6eDzBHBH8j R82VLvhDii6dYxRzIngLw_zdT_4Xjfhs5tZuGw3ivxFHc7VQ5eEE8u3hHsyDd.r8.5YrLzVxWNMc M Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ne1.yahoo.com with HTTP; Thu, 5 Mar 2020 17:06:23 +0000 Date: Thu, 5 Mar 2020 17:06:17 +0000 (UTC) From: Virendra Kumar Reply-To: Virendra Kumar To: Laurenz Albe , "pgsql-general@lists.postgresql.org" , Daulat Ram Message-ID: <1087099197.4979138.1583427977985@mail.yahoo.com> In-Reply-To: References: <1aa5a345543ea85b3e0e7d3021ed6b1cdc04e66c.camel@cybertec.at> Subject: Re: Real application clustering in postgres. MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_4979137_1899414902.1583427977984" X-Mailer: WebService/1.1.15302 YMailNorrin Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Firefox/68.0 Content-Length: 8389 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_4979137_1899414902.1583427977984 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Failover is easy but failback is little bit tricky.I have implemented failb= ack 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 conn= ecting to it otherwise there will be split brain and data-mistach between t= wo instances. I implemented it by using a virtual IP mounting on server whi= ch 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 pr= imary) is caught up with primary do failback4. Repeat steps #1-#3 to make f= ailed over instance slave again. Regards,Virendra =20 On Thursday, March 5, 2020, 8:48:54 AM PST, Daulat Ram wrote: =20 =20 Thanks for your inputs Laurenz Albe. Would you please explain single-master failover solution. Suppose we have promoted=C2=A0 standby (replica) as master after the h/w is= sue at Master.=20 If after few hours we recovered=C2=A0 the h/w then how we can switchback on= the old primary. .=20 As in Oracle we have switchover method for Dataguard. How we can do in Post= gres. Thanks, -----Original Message----- From: Laurenz Albe =20 Sent: Thursday, March 5, 2020 5:37 PM To: Daulat Ram ; 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 i= n Postgres as in Oracle we have a=C2=A0 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 c= an only scale for more CPUs; I/O remains the bottleneck. RAC is not really a high availability solution: because of the shared stora= ge, 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 applicatoi= n 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 =20 ------=_Part_4979137_1899414902.1583427977984 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Failover is easy but failbac= k is little bit tricky.
I have = implemented failback by doing following steps:

1. Start o= riginal primary which will be doing crash recovery. It should be designed i= n 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 instanc= es. I implemented it by using a virtual IP mounting on server which is actu= al primary using keepalived.
2.= Shutdown original primary and do a pg_rewind to make that as slave for new= primary.
3. Once slave (origin= al primary) is caught up with primary do failback
4. Repeat steps #1-#3 to make failed over instance slave= again.

Rega= rds,
Virendra


=20
=20
On Thursday, March 5, 2020, 8:48:54 AM PST, Daulat Ram = <daulat.ram@exponential.com> wrote:


Thanks for your inputs Laurenz Albe.<= br clear=3D"none">
Would you please explain single-master= failover solution.

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

A= s in Oracle we have switchover method for Dataguard. How we can do in Postg= res.

Thanks,

-----Original Message-----
From: Laurenz Albe <<= a shape=3D"rect" href=3D"mailto:laurenz.albe@cybertec.at" rel=3D"nofollow" = target=3D"_blank">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 clusteri= ng in Postgres as in Oracle we have a  RAC feature.
=
No, and as far as I know nobody feels interested in prov= iding it.

RAC is a complicated archite= cture that doesn't do much good, so most people feel that it would be a was= te of time and effort.

RAC ist not rea= lly a scaling solution: because of the shared storage, you can only scale f= or more CPUs; I/O remains the bottleneck.

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

Today, people use shared-nothing architectures for high avaliability, l= ike Patroni.

> What about multi-mas= ter 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/e= n/resources/postgres-bdr-2ndquadrant/

But multi-master replication is complicated to get right, and an applic= atoin 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

------=_Part_4979137_1899414902.1583427977984--