Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l04AA-0005c3-Ks for pgsql-admin@arkaria.postgresql.org; Thu, 14 Jan 2021 15:03:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l04A9-0002aH-IR for pgsql-admin@arkaria.postgresql.org; Thu, 14 Jan 2021 15:03:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l04A8-0002aA-TY for pgsql-admin@lists.postgresql.org; Thu, 14 Jan 2021 15:03:49 +0000 Received: from resqmta-ch2-09v.sys.comcast.net ([2001:558:fe21:29:69:252:207:41]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l04A5-0007Ps-64 for pgsql-admin@lists.postgresql.org; Thu, 14 Jan 2021 15:03:48 +0000 Received: from resomta-ch2-13v.sys.comcast.net ([69.252.207.109]) by resqmta-ch2-09v.sys.comcast.net with ESMTP id 03QflhlHskWiz04A0lwIkc; Thu, 14 Jan 2021 15:03:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1610636620; bh=E1vOLB09yRug9bNDMXXrdQykbJLyXYpY6h0KHv7o19U=; h=Received:Received:Content-Type:Mime-Version:Subject:From:Date: Message-Id:To; b=WZl6P+blvGw4r6+xkst2Rq+U6Xj2vDZkAtE2RIr/BJKG2fPuDvCwVynoAPDqEY0GF DDK+tW15pDIkw6ERDJaA3p4FX8KW6JYPx/DZooApODjFpPoFYB6xAppozIYe4Zmt9u w2vbb5/cvOREbRaIgjamZ6F/LjX6ZNjaPkM4O1RmvgKzTvpIuSY1+BjyHWh4JSht5q vDmIhLbYySXwliQd/Q9uWZn6AC8yn6jOrCAhG3Pzv/aNfqI2Is9DkAU4dDGz2nZBtK S08m54ntG8Dpv6OS/MdY8dpCWbMbRSBx0s6kPhf5k/QYrmtpfPyTjLS8UEC4dWQwrU YCKti/XCNcEVg== Received: from [IPv6:2601:240:d081:59d0:45c1:58c1:79d1:d3c0] ([IPv6:2601:240:d081:59d0:45c1:58c1:79d1:d3c0]) by resomta-ch2-13v.sys.comcast.net with ESMTPA id 049ylsHh9XKly049zllU2H; Thu, 14 Jan 2021 15:03:39 +0000 X-Xfinity-VMeta: sc=-100.00;st=legit Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.40.0.2.32\)) Subject: Re: PostgreSQL replication failover From: John Wiencek X-Priority: 3 In-Reply-To: Date: Thu, 14 Jan 2021 09:03:38 -0600 Cc: Ganesh Korde , Pepe TD Vo , Pgsql-admin , Laurenz Albe Content-Transfer-Encoding: quoted-printable Message-Id: References: <976875a5adf1c1cda0d55e6da0313f30dc8059f6.camel@cybertec.at> <526397214.877472.1610544243527@mail.yahoo.com> To: Jan Peters X-Mailer: Apple Mail (2.3654.40.0.2.32) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi You can use repmgr, which is free, or EFM which requires a = subscription. John=20 > On Jan 14, 2021, at 2:16 AM, Jan Peters wrote: >=20 > Hello, >=20 > thank you very much for the answers.=20 > Can you tell me some tools, but they must be available for s390 = ZLinux. > For our purposes in redhat linux=20 >=20 >=20 > Gesendet: Mittwoch, 13. Januar 2021 um 19:46 Uhr > Von: "Ganesh Korde" > An: "Pepe TD Vo" > Cc: "Jan Peters" , pgsql-admin@lists.postgresql.org, = "Laurenz Albe" > Betreff: Re: PostgreSQL replication failover >=20 > You can use different tools which detects if primary fails and = automatically promotes standby.=20 > =20 > To assure all data on standby you should use synchronous replication.=20= >=20 > On Wed, 13 Jan 2021, 6:54 pm Pepe TD Vo, = wrote: >=20 >>> If you shut down the primary server cleanly, all changes will be = replicated,so you should be good. >=20 >>> During a failover, that is, if the primary suddenly fails, there is = always > the possibility that you lose some transactions, unless you use = synchronous > you said above which I don't need to run promote to make it failover = as long as I set synchronous on? The last couple of weeks I have a = failure on the primary server and can't run on a slave. It picks up as = reading mode only. > =20 >=20 > Bach-Nga >=20 > No one in this world is pure and perfect. If you avoid people for = their mistakes you will be alone. So judge less, love, and forgive more. > To call him a dog hardly seems to do him justice though in as much as = he had four legs, a tail, and barked, I admit he was, to all outward = appearances. But to those who knew him well, he was a perfect gentleman = (Hermione Gingold) > **Live simply **Love generously **Care deeply **Speak kindly. > *** Genuinely rich *** Faithful talent *** Sharing success > =20 > =20 > =20 > =20 >=20 > On Wednesday, January 13, 2021, 06:25:53 AM EST, Laurenz Albe = wrote: > =20 > =20 >=20 > On Wed, 2021-01-13 at 09:27 +0100, Jan Peters wrote: >> we are running postgresqlserver on s390 zLinux machines. The = distribution >> is RedHat 7 and RedHat 8, so we do not have the many x86 tools = available. >>=20 >> We always run 2 instances with a replication (streaming) async mode, = the replica >> is in hot_standby and we use it for read-only accesses. About the = setup we have the following question: >>=20 >> How is an orderly failover accomplished? Our current procedure is. >>=20 >> 1. primary stop >> 2. promote replica to primary >> 3. create standby.signal on old primary >> 4. change primary_conninfo on old primary >> 5. start old primary as new replica >>=20 >> Is this processing correct? Are there any other steps that simplify a = failover? >> How can we be sure that all changes have been transferred from the = old master to the replica? >=20 > What you describe is not a failover, but a switchover. >=20 > If you shut down the primary server cleanly, all changes will be = replicated, > so you should be good. >=20 > During a failover, that is, if the primary suddenly fails, there is = always > the possibility that you lose some transactions, unless you use = synchronous > replication. >=20 > Yours, > Laurenz Albe > -- > Cybertec | = https://www.cybertec-postgresql.com[https://www.cybertec-postgresql.com] >=20 >=20 > =20 >=20 >=20