Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YT2bZ-0007oA-Ij for pgsql-admin@arkaria.postgresql.org; Wed, 04 Mar 2015 06:16:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YT2bY-0006Mq-UY for pgsql-admin@arkaria.postgresql.org; Wed, 04 Mar 2015 06:16:24 +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 1YT2bY-0006Mh-2T for pgsql-admin@postgresql.org; Wed, 04 Mar 2015 06:16:24 +0000 Received: from forward8l.mail.yandex.net ([2a02:6b8:0:1819::8]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YT2bU-0002YW-2e for pgsql-admin@postgresql.org; Wed, 04 Mar 2015 06:16:23 +0000 Received: from smtp2m.mail.yandex.net (smtp2m.mail.yandex.net [77.88.61.129]) by forward8l.mail.yandex.net (Yandex) with ESMTP id 40C051A41375; Wed, 4 Mar 2015 09:16:15 +0300 (MSK) Received: from smtp2m.mail.yandex.net (localhost [127.0.0.1]) by smtp2m.mail.yandex.net (Yandex) with ESMTP id C1248420B8C; Wed, 4 Mar 2015 09:16:14 +0300 (MSK) Received: from 130.193.35.93-vpna.dhcp.yndx.net (130.193.35.93-vpna.dhcp.yndx.net [130.193.35.93]) by smtp2m.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id yOp3pWIi3s-GEAWeV2H; Wed, 4 Mar 2015 09:16:14 +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=1425449774; bh=yseta+37ZJWUmAAF9dHm9C41tDdcCUvyYhgThJFHZag=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Message-Id:References:To:X-Mailer; b=ZPB7btOf7+qiD/FtIebPW6w0MD2alHELPvZ1J+ZrL4j1e6w5PG3XZfsK5433fA4+N FgX/O0HwAX9EXWIVggIwYV2Wt7RHu3HiYrkqTMFYTDGkBmW+04s3ur4rgVIsKbkbug zB053KZ1EO0hhdCm2n++l/krtby2FTHAcV2R3ILY= Authentication-Results: smtp2m.mail.yandex.net; dkim=pass header.i=@simply.name Content-Type: multipart/alternative; boundary="Apple-Mail=_B46F4790-ED4E-4B95-B2DB-0E8FB5767425" 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 09:16:13 +0300 Cc: pgsql-admin@postgresql.org Message-Id: References: To: Rob Emery X-Mailer: Apple Mail (2.2070.6) X-Pg-Spam-Score: -2.3 (--) 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=_B46F4790-ED4E-4B95-B2DB-0E8FB5767425 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi. > 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! https://github.com/vmware/pg_rewind = is the solution for your problem. >=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 > > > > > -- May the force be with you=E2=80=A6 https://simply.name --Apple-Mail=_B46F4790-ED4E-4B95-B2DB-0E8FB5767425 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 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

= --Apple-Mail=_B46F4790-ED4E-4B95-B2DB-0E8FB5767425--