From s5aly@yahoo.com Tue Jun 7 16:32:41 2011 Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 429F0B5F5B5 for ; Tue, 7 Jun 2011 13:32:41 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 29495-03 for ; Tue, 7 Jun 2011 16:32:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from nm13-vm0.bullet.mail.ne1.yahoo.com (nm13-vm0.bullet.mail.ne1.yahoo.com [98.138.91.48]) by mail.postgresql.org (Postfix) with SMTP id 6DB9BB5F5B0 for ; Tue, 7 Jun 2011 13:32:32 -0300 (ADT) Received: from [98.138.90.50] by nm13.bullet.mail.ne1.yahoo.com with NNFMP; 07 Jun 2011 16:32:31 -0000 Received: from [98.138.89.249] by tm3.bullet.mail.ne1.yahoo.com with NNFMP; 07 Jun 2011 16:32:31 -0000 Received: from [127.0.0.1] by omp1041.mail.ne1.yahoo.com with NNFMP; 07 Jun 2011 16:32:31 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 808572.46303.bm@omp1041.mail.ne1.yahoo.com Received: (qmail 13084 invoked by uid 60001); 7 Jun 2011 16:32:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1307464351; bh=dpln67lfCcrOYQ2Ivlj2uw/dCbxpFqmglddISAziOMk=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=1p61VkBxeWdsyCurz4a0zzOGsLQbjvj+gZefUSMlnNmvF8M8G8nEE2ijcrDP4O1/SZJqzVs6pKuhzkt8PzV2EEILv4aPmeIQWCVdwjgXV86stEPDtRVpfWGci+Zbu9YRV3uwLrm33CDgpzIafAyXggO8itXGdgP57NJfEh/5j8Q= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=6HrRmvddryq8CSoIteP1ZtMf4cDaePBzRqGObtNgpjRovBUAVF4qpRnG06zxCQ8w3gzdAygvdGJoOzTRPGi6m1WjGDucYKMupgormoKE4Ssbm2jRiWYM24UUF6UuRyCHcN3EDS+8Snlf6uG54MBvYcXRMmCodSZtFWgtzN9R1Zg=; Message-ID: <693391.31715.qm@web120020.mail.ne1.yahoo.com> X-YMail-OSG: BECcvsAVM1mjJf.XYTM7H9.zGZR9_UYrEVRe8hgX1FCAdbp HTsoIbTz17B0dZmpNemum6OA29hsLWi8Zc44KSbtBN5HX6G22xQPttumpyRz 6Zvq61EhgfdhZWNV.HX_x9ysDnXLHRb_xMMsa5A6hl0.Pco_9oTQpqTNKnr6 SdM1t8YmWG43MSmILIksNkbBsfh7.jUKfphLvuoBGVAvhYCYbBJDOaCZQfRk 3fvko0yKVklntjTis9ualiJJZYwaIK_zxLB3N2uJZ__LmBQea2.G7VnTHbPQ Buj8Kv8zze20iRUOMqteVAz_Is6OeewTv3FPiDA_2aZN8iAbekg8- Received: from [64.61.91.74] by web120020.mail.ne1.yahoo.com via HTTP; Tue, 07 Jun 2011 09:32:31 PDT X-Mailer: YahooMailRC/570 YahooMailWebService/0.8.111.304355 Date: Tue, 7 Jun 2011 09:32:31 -0700 (PDT) From: A J Subject: Switchover of Master and Slave roles To: pgsql-admin@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-138916902-1307464351=:31715" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.897 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RFC_ABUSE_POST=0.001, T_RP_MATCHES_RCVD=-0.01, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201106/29 X-Sequence-Number: 37655 --0-138916902-1307464351=:31715 Content-Type: text/plain; charset=us-ascii Hello, I am trying to switch the master and slave roles in a test I am doing with streaming replication in 9.1 beta. To start with, I have one master (N1 node) and one slave (N2 node). I stop N1 and promote N2 as primary (by touching the trigger file). Now I wish for N1 to come back up as slave of N2. How should I do that ? I tried creating a recovery.conf in N1's directory, along with cleaning up its pg_xlog and pg_log. But when I start N1 and try to connect to it, I get the message: psql: FATAL: the database system is starting up And the log file of N1 says: FATAL: timeline 2 of the primary does not match recovery target timeline 1 Any ideas on what could I be missing ? Thanks, AJ --0-138916902-1307464351=:31715 Content-Type: text/html; charset=us-ascii
Hello,
I am trying to switch the master and slave roles in a test I am doing with streaming replication in 9.1 beta.

To start with, I have one master (N1 node) and one slave (N2 node).

I stop N1 and promote N2 as primary (by touching the trigger file).
Now I wish for N1 to come back up as slave of N2. How should I do that ?

I tried creating a recovery.conf in N1's directory, along with cleaning up its pg_xlog and pg_log.
But when I start N1 and try to connect to it, I get the message:
psql: FATAL:  the database system is starting up

And the log file of N1 says:
FATAL:  timeline 2 of the primary does not match recovery target timeline 1

Any ideas on what could I be missing ?

Thanks,
AJ

--0-138916902-1307464351=:31715-- From stellr@cns.vt.edu Tue Jun 7 18:16:12 2011 Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id A33FFB5FBC3 for ; Tue, 7 Jun 2011 15:16:12 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 18916-02-6 for ; Tue, 7 Jun 2011 18:16:05 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from locust.cns.vt.edu (locust.cns.vt.edu [198.82.169.14]) by mail.postgresql.org (Postfix) with ESMTP id E40C8B5F5C4 for ; Tue, 7 Jun 2011 15:12:48 -0300 (ADT) Received: by locust.cns.vt.edu (Postfix, from userid 986) id 39BA91189F5; Tue, 7 Jun 2011 14:12:44 -0400 (EDT) Date: Tue, 7 Jun 2011 14:12:44 -0400 From: Ray Stell To: A J Cc: pgsql-admin@postgresql.org Subject: Re: Switchover of Master and Slave roles Message-ID: <20110607181244.GA3861@cns.vt.edu> References: <693391.31715.qm@web120020.mail.ne1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <693391.31715.qm@web120020.mail.ne1.yahoo.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/31 X-Sequence-Number: 37657 On Tue, Jun 07, 2011 at 09:32:31AM -0700, A J wrote: > Hello, > I am trying to switch the master and slave roles in a test I am doing with > streaming replication in 9.1 beta. > http://www.postgresql.org/docs/9.1/static/warm-standby-failover.html Once failover to the standby occurs, there is only a single server in operation. This is known as a degenerate state. The former standby is now the primary, but the former primary is down and might stay down. To return to normal operation, a standby server must be recreated, either on the former primary system when it comes up, or on a third, possibly new, system. Once complete, the primary and standby can be considered to have switched roles. From s5aly@yahoo.com Tue Jun 7 18:34:15 2011 Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 7F057B5DC29 for ; Tue, 7 Jun 2011 15:34:15 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 91584-09 for ; Tue, 7 Jun 2011 18:34:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from nm20-vm2.bullet.mail.ne1.yahoo.com (nm20-vm2.bullet.mail.ne1.yahoo.com [98.138.91.208]) by mail.postgresql.org (Postfix) with SMTP id 2F663B5DC19 for ; Tue, 7 Jun 2011 15:34:06 -0300 (ADT) Received: from [98.138.90.48] by nm20.bullet.mail.ne1.yahoo.com with NNFMP; 07 Jun 2011 18:34:06 -0000 Received: from [98.138.89.164] by tm1.bullet.mail.ne1.yahoo.com with NNFMP; 07 Jun 2011 18:34:06 -0000 Received: from [127.0.0.1] by omp1020.mail.ne1.yahoo.com with NNFMP; 07 Jun 2011 18:33:56 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 371200.53808.bm@omp1020.mail.ne1.yahoo.com Received: (qmail 20523 invoked by uid 60001); 7 Jun 2011 18:33:56 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1307471636; bh=zQ9eJN/Du0Y17MR0DNmpg9RmKjvd07/axhgSVBljaOQ=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=PqXqa6XAMOEXE1NIdTxYcqh/Vm6qqzQLzTRqzYXhY1p7iMpU/OvlTeUiTFFfLxU0aWWbaLHm7sStSXA00VveTrwTNt7p6kRKE4qtJmfye4dbREuEzkDD01OF/Qz5rBa69far5ZlJZQQOd7Dosk3+/NF2C8L5lU+Fe+yacQgyLzQ= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=NgX453cJf+I7BCUZ5YpgyqBUGwdyyvXGum2iFT4n8Awyv+29Aq7sPjsWKOAkV1HyTp/lgWCChjVr36M21KQnV3xcBMbZFHTUAiaWsZOZySG8MIO00Dj2VgIzvbvb8Jukg5niAXgo1V5s89ws/4l2rhhjB/oFrTPIAUj6mpIWBsA=; Message-ID: <264025.13168.qm@web120005.mail.ne1.yahoo.com> X-YMail-OSG: 05eo7QQVM1k3.u8ZZFifbLGC9zJgEvUeVCLSsbz7L6PnQ_F .ps2vl0.KeO7c81xVPQ1i3HwaKKa02y9G1EwFYxqOvLSM1ehp8Go9zmQB8Wn 7p2kPePiZK4Ze8m4K_bPjwBit1U30YCeH8.QAtGITJ7IiLzPZF._6.opmEbh a5HnJ8_YlLKtWjZYqA86SPHAaelOwCdjLMcgJ4zFTPhThAz8gW9prOZ25Bq8 ErUFEwfZSP_MX0SxuIST5N_1FhUdLpdMq1Qpuwv6y89YKiDGz4RO2dGVyDWe eDNPwRYxI9.J6v7W6XcBR2KwLUgOe.osBI9qKY1whhWsSdct11aIAMP5bbRD rmKPyVtRu Received: from [64.61.91.74] by web120005.mail.ne1.yahoo.com via HTTP; Tue, 07 Jun 2011 11:33:56 PDT X-Mailer: YahooMailRC/570 YahooMailWebService/0.8.111.304355 References: <693391.31715.qm@web120020.mail.ne1.yahoo.com> <20110607181244.GA3861@cns.vt.edu> Date: Tue, 7 Jun 2011 11:33:56 -0700 (PDT) From: A J Subject: Re: Switchover of Master and Slave roles To: Ray Stell Cc: pgsql-admin@postgresql.org In-Reply-To: <20110607181244.GA3861@cns.vt.edu> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1544563754-1307471636=:13168" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.907 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RFC_ABUSE_POST=0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/32 X-Sequence-Number: 37658 --0-1544563754-1307471636=:13168 Content-Type: text/plain; charset=us-ascii >>To return to normal operation, a standby server must be recreated, either on the >>former primary system when it comes up<< What does it exactly mean to 'recreate a standby server' ? Can I not use the datafiles on the former primary and just let it sync and get the incremental from the new primary ? Do I have to remove all the data files from the former primary and get all the datafiles through rsync (or other similar manner) from the new primary ? ________________________________ From: Ray Stell To: A J Cc: pgsql-admin@postgresql.org Sent: Tue, June 7, 2011 2:12:44 PM Subject: Re: [ADMIN] Switchover of Master and Slave roles On Tue, Jun 07, 2011 at 09:32:31AM -0700, A J wrote: > Hello, > I am trying to switch the master and slave roles in a test I am doing with > streaming replication in 9.1 beta. > http://www.postgresql.org/docs/9.1/static/warm-standby-failover.html Once failover to the standby occurs, there is only a single server in operation. This is known as a degenerate state. The former standby is now the primary, but the former primary is down and might stay down. To return to normal operation, a standby server must be recreated, either on the former primary system when it comes up, or on a third, possibly new, system. Once complete, the primary and standby can be considered to have switched roles. --0-1544563754-1307471636=:13168 Content-Type: text/html; charset=us-ascii
>>To return to normal operation, a standby server must be recreated, either on the former primary system when it comes up<<

What does it exactly mean to 'recreate a standby server' ? Can I not use the datafiles on the former primary and just let it sync and get the incremental from the new primary ? Do I have to remove all the data files from the former primary and get all the datafiles through rsync (or other similar manner) from the new primary ?



From: Ray Stell <stellr@cns.vt.edu>
To: A J <s5aly@yahoo.com>
Cc: pgsql-admin@postgresql.org
Sent: Tue, June 7, 2011 2:12:44 PM
Subject: Re: [ADMIN] Switchover of Master and Slave roles

On Tue, Jun 07, 2011 at 09:32:31AM -0700, A J wrote:
> Hello,
> I am trying to switch the master and slave roles in a test I am doing with
> streaming replication in 9.1 beta.
>

http://www.postgresql.org/docs/9.1/static/warm-standby-failover.html

Once failover to the standby occurs, there is only a single server in
operation. This is known as a degenerate state. The former standby is
now the primary, but the former primary is down and might stay down. To
return to normal operation, a standby server must be recreated, either
on the former primary system when it comes up, or on a third, possibly
new, system. Once complete, the primary and standby can be considered
to have switched roles.
--0-1544563754-1307471636=:13168-- From guillaume@lelarge.info Tue Jun 7 18:40:52 2011 Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 5C994B5DC29 for ; Tue, 7 Jun 2011 15:40:52 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 40032-01-5 for ; Tue, 7 Jun 2011 18:40:44 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd-17937.dedibox.fr (sd-17937.dedibox.fr [88.191.100.74]) by mail.postgresql.org (Postfix) with ESMTP id AF1CCB5F54D for ; Tue, 7 Jun 2011 15:40:04 -0300 (ADT) Received: from [192.168.10.3] (ASte-Genev-Bois-153-1-40-45.w83-200.abo.wanadoo.fr [83.200.90.45]) by sd-17937.dedibox.fr (Postfix) with ESMTPA id 9B4CA3B8F5; Tue, 7 Jun 2011 20:40:03 +0200 (CEST) Subject: Re: Switchover of Master and Slave roles From: Guillaume Lelarge To: A J Cc: Ray Stell , pgsql-admin@postgresql.org Date: Tue, 07 Jun 2011 20:40:03 +0200 In-Reply-To: <264025.13168.qm@web120005.mail.ne1.yahoo.com> References: <693391.31715.qm@web120020.mail.ne1.yahoo.com> <20110607181244.GA3861@cns.vt.edu> <264025.13168.qm@web120005.mail.ne1.yahoo.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.0.2 (3.0.2-1.fc15) Content-Transfer-Encoding: 7bit Message-ID: <1307472003.2027.1.camel@laptop> Mime-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201106/33 X-Sequence-Number: 37659 On Tue, 2011-06-07 at 11:33 -0700, A J wrote: > >>To return to normal operation, a standby server must be recreated, > either on the former primary system when it comes up<< > > > What does it exactly mean to 'recreate a standby server' ? Can I not > use the datafiles on the former primary and just let it sync and get > the incremental from the new primary ? Do I have to remove all the > data files from the former primary and get all the datafiles through > rsync (or other similar manner) from the new primary ? > > Don't remove them. This way, rsync will only send the changed files. -- Guillaume http://blog.guillaume.lelarge.info http://www.dalibo.com From Kevin.Grittner@wicourts.gov Tue Jun 7 18:44:59 2011 Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id B240CB5DC29 for ; Tue, 7 Jun 2011 15:44:59 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 41907-06 for ; Tue, 7 Jun 2011 18:44:52 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 2A3DCB5DC19 for ; Tue, 7 Jun 2011 15:44:52 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Tue, 07 Jun 2011 13:44:51 -0500 Message-Id: <4DEE2B49020000250003E2A2@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Tue, 07 Jun 2011 13:44:41 -0500 From: "Kevin Grittner" To: "Ray Stell" ,"A J" Cc: Subject: Re: Switchover of Master and Slave roles References: <693391.31715.qm@web120020.mail.ne1.yahoo.com> <20110607181244.GA3861@cns.vt.edu> <264025.13168.qm@web120005.mail.ne1.yahoo.com> In-Reply-To: <264025.13168.qm@web120005.mail.ne1.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/34 X-Sequence-Number: 37660 A J wrote: > What does it exactly mean to 'recreate a standby server' ? Can I > not use the datafiles on the former primary and just let it sync > and get the incremental from the new primary ? Do I have to remove > all the data files from the former primary and get all the > datafiles through rsync (or other similar manner) from the new > primary ? The old server will probably be close enough that judicious use of rsync with the old copy as the target will allow a base backup to be taken very quickly. -Kevin From s5aly@yahoo.com Tue Jun 7 18:59:34 2011 Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 00512B5DF4D for ; Tue, 7 Jun 2011 15:59:34 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 31411-04 for ; Tue, 7 Jun 2011 18:59:26 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from nm19.bullet.mail.ne1.yahoo.com (nm19.bullet.mail.ne1.yahoo.com [98.138.90.82]) by mail.postgresql.org (Postfix) with SMTP id 8E45FB5DF46 for ; Tue, 7 Jun 2011 15:59:26 -0300 (ADT) Received: from [98.138.90.56] by nm19.bullet.mail.ne1.yahoo.com with NNFMP; 07 Jun 2011 18:59:25 -0000 Received: from [98.138.87.5] by tm9.bullet.mail.ne1.yahoo.com with NNFMP; 07 Jun 2011 18:59:25 -0000 Received: from [127.0.0.1] by omp1005.mail.ne1.yahoo.com with NNFMP; 07 Jun 2011 18:59:07 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 475982.52241.bm@omp1005.mail.ne1.yahoo.com Received: (qmail 3730 invoked by uid 60001); 7 Jun 2011 18:59:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1307473147; bh=1xJxLJY8HqsZZKNTLa60pIJvBuILUeAPn9SqIyjHgj4=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=THBhtO5pmPgea+pDN4p4LL8ESckcOYMMuvChR5ICCWG6xsXoAhcPRYkGxUbXnJny4rpsbPRTdiPDX1XrEJgpkT7EoR2Eia38UWZ9ljt5Eum+hEaLVDd97ymw1y+/lhzWd5ql+I3rJFd/1IViv5JVw3Qe0961pFNvrIpL6YXMZKc= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=xgCvPdp7K9ndkOK1x48+GLGOrl0rbPIs0cIDZ26JqVRiBgcSfS5pyLaem05w7x419RS+zBUCfJN1+2eoSl8qJcHZhiaiRlKHVIBwHxboqH8n9kwrfzM69xauHcqp6c5wFlLB2Yl5LnybiKSc+l3X9lZF+ZFF7IdZzXf0NZ2ycIM=; Message-ID: <349220.32155.qm@web120008.mail.ne1.yahoo.com> X-YMail-OSG: 5h5YIJAVM1lmgh0mPDuN8JlXxs...EQUM0GmDdT27TxarDD ayYibTqQmaQmKMckBTH4SvclEbG9aRq_0HrcZnkNqKSRAhvFfAdbtvBHM0Zh YbWNMdpbLg1Im5mdgtN_KHe4_cwh3mGoiqgHxxzsNTLbfcuKsslVR7pCwNdi bZAUgHNAu.qG2a5FO6BDM0Xm1FFXe01OihNzuC41.V5CEYaPu_EKJg1Uk8DQ KZaqYlDOEFPik1TgSy6l64TRDnYS7S1J80Rbx9zFsCWIjjIj36zc.ECyCovB 5SLzIikHT_MTv4zabs3qckxFB5XlOjoRERXlUXNkvdVVhomU- Received: from [64.61.91.74] by web120008.mail.ne1.yahoo.com via HTTP; Tue, 07 Jun 2011 11:59:07 PDT X-Mailer: YahooMailRC/570 YahooMailWebService/0.8.111.304355 References: <693391.31715.qm@web120020.mail.ne1.yahoo.com> <20110607181244.GA3861@cns.vt.edu> <264025.13168.qm@web120005.mail.ne1.yahoo.com> <4DEE2B49020000250003E2A2@gw.wicourts.gov> Date: Tue, 7 Jun 2011 11:59:07 -0700 (PDT) From: A J Subject: Re: Switchover of Master and Slave roles To: Kevin Grittner , Ray Stell Cc: pgsql-admin@postgresql.org In-Reply-To: <4DEE2B49020000250003E2A2@gw.wicourts.gov> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-314295098-1307473147=:32155" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.907 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RFC_ABUSE_POST=0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/35 X-Sequence-Number: 37661 --0-314295098-1307473147=:32155 Content-Type: text/plain; charset=us-ascii Ok. So if I understand it correctly, as far as Postgres is concerned the 'mirror is broken'. It is a one-time cutover. We then rely on filesystem tools (or other third party tools) to get the original master in sync with the new master efficiently and then make it join as slave. Right ? ________________________________ From: Kevin Grittner To: Ray Stell ; A J Cc: pgsql-admin@postgresql.org Sent: Tue, June 7, 2011 2:44:41 PM Subject: Re: [ADMIN] Switchover of Master and Slave roles A J wrote: > What does it exactly mean to 'recreate a standby server' ? Can I > not use the datafiles on the former primary and just let it sync > and get the incremental from the new primary ? Do I have to remove > all the data files from the former primary and get all the > datafiles through rsync (or other similar manner) from the new > primary ? The old server will probably be close enough that judicious use of rsync with the old copy as the target will allow a base backup to be taken very quickly. -Kevin --0-314295098-1307473147=:32155 Content-Type: text/html; charset=us-ascii
Ok. So if I understand it correctly, as far as Postgres is concerned the 'mirror is broken'. It is a one-time cutover.
We then rely on filesystem tools (or other third party tools) to get the original master in sync with the new master efficiently and then make it join as slave.
Right ?


From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Ray Stell <stellr@cns.vt.edu>; A J <s5aly@yahoo.com>
Cc: pgsql-admin@postgresql.org
Sent: Tue, June 7, 2011 2:44:41 PM
Subject: Re: [ADMIN] Switchover of Master and Slave roles

A J <s5aly@yahoo.com> wrote:

> What does it exactly mean to 'recreate a standby server' ? Can I
> not use the datafiles on the former primary and just let it sync
> and get the incremental from the new primary ? Do I have to remove
> all the data files from the former primary and get all the
> datafiles through rsync (or other similar manner) from the new
> primary ?

The old server will probably be close enough that judicious use of
rsync with the old copy as the target will allow a base backup to be
taken very quickly.

-Kevin
--0-314295098-1307473147=:32155-- From Kevin.Grittner@wicourts.gov Tue Jun 7 19:11:44 2011 Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id B43B9B5DF46 for ; Tue, 7 Jun 2011 16:11:44 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 19572-09 for ; Tue, 7 Jun 2011 19:11:37 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 7E3AFB5DD81 for ; Tue, 7 Jun 2011 16:11:37 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Tue, 07 Jun 2011 14:11:37 -0500 Message-Id: <4DEE3197020000250003E2A8@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Tue, 07 Jun 2011 14:11:35 -0500 From: "Kevin Grittner" To: "Ray Stell" ,"A J" Cc: Subject: Re: Switchover of Master and Slave roles References: <693391.31715.qm@web120020.mail.ne1.yahoo.com> <20110607181244.GA3861@cns.vt.edu> <264025.13168.qm@web120005.mail.ne1.yahoo.com> <4DEE2B49020000250003E2A2@gw.wicourts.gov> <349220.32155.qm@web120008.mail.ne1.yahoo.com> In-Reply-To: <349220.32155.qm@web120008.mail.ne1.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/36 X-Sequence-Number: 37662 A J wrote: > Ok. So if I understand it correctly, as far as Postgres is > concerned the 'mirror is broken'. It is a one-time cutover. > We then rely on filesystem tools (or other third party tools) to > get the original master in sync with the new master efficiently > and then make it join as slave. Right ? Right. There's been talk of building in something, but it would take a lot of work to get something which would be as fast as rsync. So far nobody has stepped up offering to re-invent that wheel. -Kevin From stellr@cns.vt.edu Tue Jun 7 19:41:47 2011 Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 1E484B5E0AD for ; Tue, 7 Jun 2011 16:41:47 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 90670-01 for ; Tue, 7 Jun 2011 19:41:40 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from locust.cns.vt.edu (locust.cns.vt.edu [198.82.169.14]) by mail.postgresql.org (Postfix) with ESMTP id 1D954B5E0A7 for ; Tue, 7 Jun 2011 16:41:40 -0300 (ADT) Received: by locust.cns.vt.edu (Postfix, from userid 986) id C56471189F5; Tue, 7 Jun 2011 15:41:39 -0400 (EDT) Date: Tue, 7 Jun 2011 15:41:39 -0400 From: Ray Stell To: A J Cc: Kevin Grittner , pgsql-admin@postgresql.org Subject: Re: Switchover of Master and Slave roles Message-ID: <20110607194139.GB3861@cns.vt.edu> References: <693391.31715.qm@web120020.mail.ne1.yahoo.com> <20110607181244.GA3861@cns.vt.edu> <264025.13168.qm@web120005.mail.ne1.yahoo.com> <4DEE2B49020000250003E2A2@gw.wicourts.gov> <349220.32155.qm@web120008.mail.ne1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <349220.32155.qm@web120008.mail.ne1.yahoo.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/37 X-Sequence-Number: 37663 On Tue, Jun 07, 2011 at 11:59:07AM -0700, A J wrote: > We then rely on filesystem tools (or other third party tools) to get the > original master in sync with the new master efficiently and then make it join as > slave. the doc would not be corrupted by an additional few words that stated as such: "To return to normal operation, a standby server must be recreated using external tools such as rsync, either on the former primary system when it comes up, or on a third, possibly new, system." From simon@2ndQuadrant.com Tue Jun 7 19:47:02 2011 Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 8D4E3B5E0BE for ; Tue, 7 Jun 2011 16:47:02 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 50524-03 for ; Tue, 7 Jun 2011 19:46:55 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail149113.authsmtp.com (outmail149113.authsmtp.com [62.13.149.113]) by mail.postgresql.org (Postfix) with ESMTP id 01191B5E0AD for ; Tue, 7 Jun 2011 16:46:54 -0300 (ADT) Received: from mail-c194.authsmtp.com (mail-c194.authsmtp.com [62.13.128.121]) by punt5.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id p57Jksqc056233 for ; Tue, 7 Jun 2011 20:46:54 +0100 (BST) Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.216.174]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2) with ESMTP id p57JkldX024512 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Tue, 7 Jun 2011 20:46:48 +0100 (BST) Received: by qyk7 with SMTP id 7so1544379qyk.19 for ; Tue, 07 Jun 2011 12:46:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.141.196 with SMTP id n4mr1451700qcu.257.1307476007473; Tue, 07 Jun 2011 12:46:47 -0700 (PDT) Received: by 10.229.21.137 with HTTP; Tue, 7 Jun 2011 12:46:47 -0700 (PDT) In-Reply-To: <20110607194139.GB3861@cns.vt.edu> References: <693391.31715.qm@web120020.mail.ne1.yahoo.com> <20110607181244.GA3861@cns.vt.edu> <264025.13168.qm@web120005.mail.ne1.yahoo.com> <4DEE2B49020000250003E2A2@gw.wicourts.gov> <349220.32155.qm@web120008.mail.ne1.yahoo.com> <20110607194139.GB3861@cns.vt.edu> Date: Tue, 7 Jun 2011 20:46:47 +0100 Message-ID: Subject: Re: Switchover of Master and Slave roles From: Simon Riggs To: Ray Stell Cc: A J , Kevin Grittner , pgsql-admin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Server-Quench: e1fa102b-913e-11e0-80b9-0022640b883e X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZOTQEd DAteCiN5VAwpPBRK HVkIKg5MOFUSTAAU O0pfL1x7KFoHWV5D ViVKB0oLEgo/WWRq EU8PcgddY0teXQVg VE5DRlocFgVhHxQE GBwfVAdzcAFZfXZ3 ekcsHnVcJh8mIS59 QEpRFG9IZmBnbi5K URYJdgNWIh5DfxwQ d1F+AXMQaWVVb2dg R1VpYWxpN2UPcylD eAxfZWE7bWMqOAt0 fA8DAT4vGlMIXW00 IVQDI0UAEVxZO0M+ eWAlUEwVewUVDgBF dwAA X-Authentic-SMTP: 61633235383639.1015:706 X-AuthFastPath: 0 (Was 255) X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201106/38 X-Sequence-Number: 37664 On Tue, Jun 7, 2011 at 8:41 PM, Ray Stell wrote: > On Tue, Jun 07, 2011 at 11:59:07AM -0700, A J wrote: >> We then rely on filesystem tools (or other third party tools) to get the >> original master in sync with the new master efficiently and then make it= join as >> slave. > > the doc would not be corrupted by an additional few words that stated as = such: > > "To return to normal operation, a standby server must be recreated using > external tools such as rsync, either on the former primary system when > it comes up, or on a third, possibly new, system." You need repmgr: http://www.repmgr.org/ --=20 =A0Simon Riggs=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 http:/= /www.2ndQuadrant.com/ =A0PostgreSQL Development, 24x7 Support, Training & Services From gsievers19@comcast.net Wed Jun 8 01:11:49 2011 Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 3C99AB5DE78 for ; Tue, 7 Jun 2011 22:11:49 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 20415-04 for ; Wed, 8 Jun 2011 01:11:41 +0000 (UTC) X-Greylist: delayed 00:08:14.40977 by SQLgrey-1.7.6 Received: from qmta12.emeryville.ca.mail.comcast.net (qmta12.emeryville.ca.mail.comcast.net [76.96.27.227]) by mail.postgresql.org (Postfix) with ESMTP id 38522B5E0E3 for ; Tue, 7 Jun 2011 22:11:41 -0300 (ADT) Received: from omta16.emeryville.ca.mail.comcast.net ([76.96.30.72]) by qmta12.emeryville.ca.mail.comcast.net with comcast id tD0J1g0011ZMdJ4ACD3QK3; Wed, 08 Jun 2011 01:03:24 +0000 Received: from homie ([68.45.149.190]) by omta16.emeryville.ca.mail.comcast.net with comcast id tD391g00r46izrY8cD3AA1; Wed, 08 Jun 2011 01:03:11 +0000 Received: by homie (Postfix, from userid 1000) id 6C167181821; Tue, 7 Jun 2011 20:53:45 -0400 (EDT) To: Simon Riggs Cc: Ray Stell , A J , Kevin Grittner , pgsql-admin Subject: Re: Switchover of Master and Slave roles References: <693391.31715.qm@web120020.mail.ne1.yahoo.com> <20110607181244.GA3861@cns.vt.edu> <264025.13168.qm@web120005.mail.ne1.yahoo.com> <4DEE2B49020000250003E2A2@gw.wicourts.gov> <349220.32155.qm@web120008.mail.ne1.yahoo.com> <20110607194139.GB3861@cns.vt.edu> From: Jerry Sievers Date: Tue, 07 Jun 2011 20:53:45 -0400 In-Reply-To: (Simon Riggs's message of "Tue\, 7 Jun 2011 20\:46\:47 +0100") Message-ID: <87k4cx9m92.fsf@comcast.net> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.355 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=1.553, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RFC_ABUSE_POST=0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/41 X-Sequence-Number: 37667 Simon Riggs writes: > On Tue, Jun 7, 2011 at 8:41 PM, Ray Stell wrote: > >> On Tue, Jun 07, 2011 at 11:59:07AM -0700, A J wrote: >>> We then rely on filesystem tools (or other third party tools) to get the >>> original master in sync with the new master efficiently and then make it join as >>> slave. >> >> the doc would not be corrupted by an additional few words that stated as such: >> >> "To return to normal operation, a standby server must be recreated using >> external tools such as rsync, either on the former primary system when >> it comes up, or on a third, possibly new, system." > > You need repmgr: http://www.repmgr.org/ Well, I am not sure on the 9.x versions but, we used to do reversible master/standby with log shipping on the 8.x versions quite routinely, sometimes reshaping clusters of multiple standbys., designating a new master, restarting the old master in recovery mode and repointing the remaining standbys.. The procedure was similar to... apps down and locked out pg_rotate_xlog() on master verify final log received on standbys and consumed bring up new master kill immediate on old master and remaining standbys configure old master as standby w/recovery.conf and point to new xlog repository repoint other standbys to new repository and restart There was no need to reinitialize from scratch or rsync the old master or other standbys. Somewhere between 8.2 and 8.4 there was a change that would require you to increment the recovery target timeline during this operation. It took me a bit of head scratching to get it right. This capability was apparently little known and used, perhaps due to uncertainty that it was viable, given the undocumented nature of this. Disclaimer: I do not know if this still works on 9.x using either log shipping or streaming replication. I covered this strategy briefly during my talk at the 2010 Pg-East conference in Philly. YMMV > -- >  Simon Riggs                   http://www.2ndQuadrant.com/ >  PostgreSQL Development, 24x7 Support, Training & Services > > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin > -- Jerry Sievers Postgres DBA/Development Consulting e: gsievers19@comcast.net p: 305.321.1144 From masao.fujii@gmail.com Wed Jun 8 01:51:32 2011 Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 65D01B5DBB7 for ; Tue, 7 Jun 2011 22:51:32 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 49366-05 for ; Wed, 8 Jun 2011 01:51:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wy0-f174.google.com (mail-wy0-f174.google.com [74.125.82.174]) by mail.postgresql.org (Postfix) with ESMTP id 3A3E4B5D8B2 for ; Tue, 7 Jun 2011 22:51:25 -0300 (ADT) Received: by wya21 with SMTP id 21so22527wya.19 for ; Tue, 07 Jun 2011 18:51:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Cmligt6U+N5uWUShBluoh8/pml/xaiKb4ui+dhPlMuQ=; b=irokyEKVdjYSDqrTfLIJvLvTu6ydCvzTJVkCZ5ARqFpuQKsgToveJ5Lk5J1oeJK6c9 8VXYF5wufQorTIkMHKLQIDg9CBbExshQ8qLoCTHyXcJufKuF0SPD5s7OrCKLVjGXOIwb 3rRGwq+OLVJczzuMitWv3LYjn64XBSizKoAr0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Sh1nYfXJLhIgBfv42LXm+Se7VblOkADBc4hm3ARq2FDorYEkoKIICx1zqMb2lKZgJb 1UKheQXQQKe1XqO1mbd8luf+1Lo/sbaYtwKM1REBlK855MjFJU4rvXiQk4bTL1MKbbch EPtmo2RwepZ8krp0qUMxZfZuXs7wQNm7VmHPw= MIME-Version: 1.0 Received: by 10.216.232.13 with SMTP id m13mr4327897weq.110.1307497885074; Tue, 07 Jun 2011 18:51:25 -0700 (PDT) Received: by 10.217.1.198 with HTTP; Tue, 7 Jun 2011 18:51:25 -0700 (PDT) In-Reply-To: <349220.32155.qm@web120008.mail.ne1.yahoo.com> References: <693391.31715.qm@web120020.mail.ne1.yahoo.com> <20110607181244.GA3861@cns.vt.edu> <264025.13168.qm@web120005.mail.ne1.yahoo.com> <4DEE2B49020000250003E2A2@gw.wicourts.gov> <349220.32155.qm@web120008.mail.ne1.yahoo.com> Date: Wed, 8 Jun 2011 10:51:25 +0900 Message-ID: Subject: Re: Switchover of Master and Slave roles From: Fujii Masao To: A J Cc: Kevin Grittner , Ray Stell , pgsql-admin@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.898 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RFC_ABUSE_POST=0.001 X-Spam-Level: X-Archive-Number: 201106/42 X-Sequence-Number: 37668 On Wed, Jun 8, 2011 at 3:59 AM, A J wrote: > Ok. So if I understand it correctly, as far as Postgres is concerned the > 'mirror is broken'. It is a one-time cutover. > We then rely on filesystem tools (or other third party tools) to get the > original master in sync with the new master efficiently and then make it > join as slave. If the standby is completely sync with the master when failover happens, and if those two servers share the archive area, you can start new standby without taking a fresh base backup. You can do that by setting recovery_target_timeline to 'latest' in the recovery.conf and just starting new standby. Regards, -- Fujii Masao NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT Open Source Software Center