Re: postgres standby won't start - Mailing list pgsql-general

From Ramalingam, Sankarakumar
Subject Re: postgres standby won't start
Date
Msg-id C7BCCAFB121E934BA4FE0D9790294D57AD5EFA98@SPPATLXCHMBX01.servers.global.prv
Whole thread Raw
In response to Re: postgres standby won't start  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: postgres standby won't start
List pgsql-general
Hello Adrian,
Can I use this command so that all the data is streamed directly to the target. Target is pretty much unusable now.
ShouldI get rid of all items under my $PGDATA and leave the empty before doing the following?  

pg_basebackup -h <my target hostname>  -D <my target host directory>  -P -U replication --xlog-method=stream



Thanks
Kumar Ramalingam
X6015288


-----Original Message-----
From: Adrian Klaver [mailto:adrian.klaver@aklaver.com]
Sent: Wednesday, October 07, 2015 1:25 PM
To: Ramalingam, Sankarakumar; pgsql-general@postgresql.org
Subject: Re: [GENERAL] postgres standby won't start

On 10/07/2015 10:02 AM, Ramalingam, Sankarakumar wrote:
> Hi Adrian,
> Thanks for your prompt response. I used pg_basebackup to backup my source server. I am starting this exercise on our
QAside so I can do a dry run before hitting production. Would I be able to restore that backup on my target standby? If
yes,would you guide me to the steps. Thanks a lot for your invaluable suggestions overall to this forum. 

The steps can be found here:

http://www.postgresql.org/docs/9.4/interactive/app-pgbasebackup.html

Look at the examples at the bottom and substitute the data directory for the standby in the -D portion. Important:

-D directory
--pgdata=directory

     Directory to write the output to. pg_basebackup will create the directory and any parent directories if necessary.
Thedirectory may already exist, but it is an error if the directory already exists and is not empty. 

To be on safe side you could move the current files in the standby directory to another location before pointing
pg_basebackupat it. 

>
>
>
> Thanks
> Kumar Ramalingam
> X6015288
>
>
> -----Original Message-----
> From: Adrian Klaver [mailto:adrian.klaver@aklaver.com]
> Sent: Monday, October 05, 2015 7:35 PM
> To: Ramalingam, Sankarakumar; pgsql-general@postgresql.org
> Subject: Re: [GENERAL] postgres standby won't start
>
> On 10/05/2015 12:35 PM, Ramalingam, Sankarakumar wrote:
>> Thanks Adrian.
>>
>> My primary is doing  fine. Only the standby. I am noticing it after a while..my Bad!!
>> Primary setting
>> #--------------------------------------------------------------------
>> -
>> ---------
>> # REPLICATION
>> #--------------------------------------------------------------------
>> -
>> ---------
>>
>> max_wal_senders = 5
>> wal_sender_delay = 1s
>> wal_keep_segments = 512
>> vacuum_defer_cleanup_age = 20
>> hot_standby = on
>>
>> Since I am unable to bring standby up, would the pg_basebackup help me out here for a complete sync? Thanks again.
>
> The problem is that the WAL files got recycled on the primary and are no longer available there, which is why the
standbyis failing. If you where archiving the WAL files somewhere, you could fetch the missing WAL files from there. If
thatis not the case then you will need to rebuild the standby to the current state(more or less) of the primary. The
simplestway is to use pg_backup, but that means starting with either no data directory or an empty one on the standby.
Thedocs page steps you through the procedure. 
>
>>
>>
>>
>> Thanks
>> Kumar Ramalingam
>> X6015288
>>
>>
>
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
> The information contained in this e-mail and in any attachments is intended only for the person or entity to which it
isaddressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other
useof, or taking of any action in reliance upon, this information by persons or entities other than the intended
recipientis prohibited. This message has been scanned for known computer viruses. 
>


--
Adrian Klaver
adrian.klaver@aklaver.com
The information contained in this e-mail and in any attachments is intended only for the person or entity to which it
isaddressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other
useof, or taking of any action in reliance upon, this information by persons or entities other than the intended
recipientis prohibited. This message has been scanned for known computer viruses. 



pgsql-general by date:

Previous
From: Karsten Hilbert
Date:
Subject: Re: md5(large_object_id)
Next
From: Thomas Munro
Date:
Subject: Re: Issues with german locale on CentOS 5,6,7