Re: How to recovery failed master after failover

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: leo <dazhoufei(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to recovery failed master after failover
Date: 2014-03-05 01:50:42
Message-ID: CAB7nPqSKwviD_XvxzDtHs=Wfn0MKhv=KMEEugR2DPTCiHDJh8Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Mar 4, 2014 at 6:26 PM, leo <dazhoufei(at)gmail(dot)com> wrote:
> I wonder how to quickly recovery failed master? If I directly startup the
> failed master as slave ( assign proper parameter), is there any problem?
Yep, if the master has got ahead of the slave in term of WAL replay
where WAL forked after the slave promotion, you won't be able to
reconnect an old master as a slave. In this case, what you need to do,
is either to rewind the old master using for example pg_rewind (which
is not a tool part of Postgres core) or create a new node from scratch
with a base backup and some archives, and then reconnect it. Depending
on the size of data in server, this could take some time because of
network latency and if you create a new base backup, especially if
both nodes are on different (distant?) servers.
--
Michael

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message leo 2014-03-05 03:14:16 Re: How to recovery failed master after failover
Previous Message Venkata Balaji Nagothi 2014-03-04 23:56:45 Re: log_statement per table