Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YT4lY-0004xL-SR for pgsql-admin@arkaria.postgresql.org; Wed, 04 Mar 2015 08:34:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YT4lY-0000hx-1z for pgsql-admin@arkaria.postgresql.org; Wed, 04 Mar 2015 08:34:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YT4lW-0000hm-W1 for pgsql-admin@postgresql.org; Wed, 04 Mar 2015 08:34:51 +0000 Received: from forward10l.mail.yandex.net ([84.201.143.143]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YT4lS-00057X-Ul for pgsql-admin@postgresql.org; Wed, 04 Mar 2015 08:34:49 +0000 Received: from smtp2m.mail.yandex.net (smtp2m.mail.yandex.net [77.88.61.129]) by forward10l.mail.yandex.net (Yandex) with ESMTP id 1DF56BA1819; Wed, 4 Mar 2015 11:34:44 +0300 (MSK) Received: from smtp2m.mail.yandex.net (localhost [127.0.0.1]) by smtp2m.mail.yandex.net (Yandex) with ESMTP id 9BB29420CB9; Wed, 4 Mar 2015 11:34:43 +0300 (MSK) Received: from unknown (unknown [2a02:6b8:0:2309:9d5f:401:173f:b347]) by smtp2m.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 44zVCyG3Y0-YgAKe1XS; Wed, 4 Mar 2015 11:34:42 +0300 (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=simply.name; s=mail; t=1425458082; bh=nqcip6VaN3j2PAIj79b3GUSoS98xGYOvcRdwnPsCcI0=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Message-Id:References:To:X-Mailer; b=n+fCyLzAM4K2ciKYDUDNfzZymlqTWUbkVOmpBn7Vem5KjijxUWJJ7UxuCvwaaDg3Q +4GauLUs3qFWKunwZTTpOhpnZye6TPUfvNPCwLcgit5+qCw1+NimpA7QStHLElJXVB IHMwMmBEA9jcVyM1mOLCokmdqz7yxbemO5HFa9Ww= Authentication-Results: smtp2m.mail.yandex.net; dkim=pass header.i=@simply.name Content-Type: multipart/alternative; boundary="Apple-Mail=_AB960E98-C609-40BB-962E-A2C613E6DE75" Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: Replication: re-initialisation of failed master From: Vladimir Borodin In-Reply-To: Date: Wed, 4 Mar 2015 11:34:40 +0300 Cc: pgsql-admin@postgresql.org Message-Id: References: To: Robert Emery X-Mailer: Apple Mail (2.2070.6) X-Pg-Spam-Score: -1.6 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org --Apple-Mail=_AB960E98-C609-40BB-962E-A2C613E6DE75 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > 4 =D0=BC=D0=B0=D1=80=D1=82=D0=B0 2015 =D0=B3., =D0=B2 11:23, Robert = Emery =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0= =BB(=D0=B0): >=20 > That looks like a really cool tool, I've not seen that before!=20 >=20 > Have you used that yourself in a real scenario? Yes, I do use it for 9.3 and 9.4 in production about a couple of times a = month. >=20 > On 4 March 2015 at 06:16, Vladimir Borodin > wrote: > Hi. >=20 >> 3 =D0=BC=D0=B0=D1=80=D1=82=D0=B0 2015 =D0=B3., =D0=B2 22:59, Rob = Emery > = =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0): >>=20 >> Hello all, >>=20 >> We run a 2 node setup replicating between a master and synchronous = slave, currently when we want to failover we basically kill the master = off, create a recovery file and re-point the traffic via a DNS record = etc, we're looking at implementing a corosync/pacemaker setup shortly. >>=20 >> Once we're running with the old secondary as the master the only way = we have to re-stage the old master is to use pg_basebackup against the = new master to replace the previous master's data directory. >>=20 >> It feels that given how little has probably changed on the new master = versus the old master that there should be a faster way of = re-initializing the old master as a slave. Is there some sort of = short-cut speedup I'm missing here? I suppose I'm mainly curious as to = what techniques most admins use to accomplish this! >=20 > https://github.com/vmware/pg_rewind = is the solution for your problem. >=20 >>=20 >> Thanks in advance >> Rob >>=20 >>=20 >> >> =E2=80=8B >>=20 >> March Newsletter =C2=A0- Customers want a high quality =E2=80=98clicks = & bricks=E2=80=99 F & I experience = >>=20 >> Last Month Product Highlights = >>=20 >> Codeweavers Ltd | Barn 4 | Dunston Business Village | Dunston | ST18 = 9AB >> Registered in England and Wales No. 04092394 | VAT registration no. = 974 9705 63=20 >>=20 >> >> >> >> >> >=20 > -- > May the force be with you=E2=80=A6 > https://simply.name >=20 >=20 >=20 > --=20 > Robert Emery > Head of Infrastructure >=20 > E: robertemery@codeweavers.net | = T: 01785 711633 | W: www.codeweavers.net >=20 > > =E2=80=8B >=20 > March Newsletter =C2=A0- Customers want a high quality =E2=80=98clicks = & bricks=E2=80=99 F & I experience = >=20 > Last Month Product Highlights = >=20 > Codeweavers Ltd | Barn 4 | Dunston Business Village | Dunston | ST18 = 9AB > Registered in England and Wales No. 04092394 | VAT registration no. = 974 9705 63=20 >=20 > > > > > -- May the force be with you=E2=80=A6 https://simply.name --Apple-Mail=_AB960E98-C609-40BB-962E-A2C613E6DE75 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
4 =D0=BC=D0=B0=D1=80=D1=82=D0=B0 2015 =D0=B3., =D0=B2 11:23, = Robert Emery <robertemery@codeweavers.net> = =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0):

That looks like a = really cool tool, I've not seen that before! 

Have you used that yourself in a real = scenario?

Yes, I do use it for 9.3 and 9.4 in production = about a couple of times a month.


On 4 March 2015 at 06:16, Vladimir Borodin <root@simply.name> wrote:
Hi.

3 =D0=BC=D0=B0=D1=80=D1=82=D0=B0 2015 =D0=B3., =D0=B2 22:59, = Rob Emery <re-pgsql@codeweavers.net> = =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0):

Hello all,

We run a 2 node setup = replicating between a master and synchronous slave, currently when we = want to failover we basically kill the master off, create a recovery = file and re-point the traffic via a DNS record etc, we're looking at = implementing a corosync/pacemaker setup shortly.

Once we're running with the old = secondary as the master the only way we have to re-stage the old master = is to use pg_basebackup against the new master to replace the previous = master's data directory.

It feels that given how little has probably changed on the = new master versus the old master that there should be a faster way of = re-initializing the old master as a slave. Is there some sort of = short-cut speedup I'm missing here? I suppose I'm mainly curious as to = what techniques most admins use to accomplish = this!

https://github.com/vmware/pg_rewind is the solution = for your problem.

Thanks in advance
Rob



=E2=80=8B

March = Newsletter  - Customers want a high quality =E2=80=98clicks & = bricks=E2=80=99 F & I experience

Last Month Product = Highlights

Codeweavers = Ltd | Barn 4 | Dunston = Business Village | Dunston | ST18 9AB
Registered in England = and Wales No. 04092394 | VAT registration no. 974 9705 = 63 

<= /table>
<= /table>
<= /table>
<= /table>
<= /table>


--
May the force be with you=E2=80=A6




-- 
Robert Emery
Head of Infrastructure

E: robertemery@codeweavers.net | T: 01785 711633 | = W: www.codeweavers.net



=E2=80=8B

March = Newsletter  - Customers want a high quality =E2=80=98clicks & = bricks=E2=80=99 F & I experience

Last Month Product = Highlights

Codeweavers = Ltd | Barn 4 | Dunston = Business Village | Dunston | ST18 9AB
Registered in England = and Wales No. 04092394 | VAT registration no. 974 9705 = 63 

<= /table>
<= /table>
<= /table>
<= /table>
<= /table>


--
May the force be with you=E2=80=A6

= --Apple-Mail=_AB960E98-C609-40BB-962E-A2C613E6DE75--