Re: Turning slave into a master - PostgreSQL 9.2

From: Patrick B <patrickbakerbr(at)gmail(dot)com>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Turning slave into a master - PostgreSQL 9.2
Date: 2016-11-02 00:48:35
Message-ID: CAJNY3itEJpmkHf1si14x4gTTV-9NPGo3G=nUcZmD0Nm_5EzUxA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2016-11-02 8:43 GMT+13:00 Patrick B <patrickbakerbr(at)gmail(dot)com>:

>
>
> 2016-11-02 2:55 GMT+13:00 Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>:
>
>> On Mon, Oct 31, 2016 at 8:01 PM, Patrick B <patrickbakerbr(at)gmail(dot)com>
>> wrote:
>> > If I change recovery.conf:
>> >
>> > recovery_target_time = '2016-10-30 02:24:40'
>> >
>> >
>> > I get error:
>> >
>> > FATAL: requested recovery stop point is before consistent recovery
>> point
>>
>> You can try using pg_basebackup to get the replica setup. In 9.2 you
>> gotta make your own recovery.conf, but you already know how to do
>> that. Way easier than trying to rsync by hand etc.
>>
>
>
> I did a pg_basebackup!
>

Hi guys,

I was able to fix it doing:

recovery.conf:

> restore_command = 'cp /var/lib/pgsql/archive/%f %p'
> recovery_target_timeline = 'latest'
> standby_mode = off
> trigger_file = '/tmp/pg_failover_trigger'

Then, I got the error:

> FATAL: archive file "00000002000019D5000000EC" has wrong size: 0 instead
> of 16777216

To fix it:

rm 00000002000019D5000000EC

Restart postgres and then:

> LOG: archive recovery complete
> LOG: database system is ready to accept connections

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2016-11-02 01:13:06 Re: Turning slave into a master - PostgreSQL 9.2
Previous Message Michael Paquier 2016-11-02 00:28:46 Re: Validity of using the test_decoding plugin for production?