From: | "Ramalingam, Sankarakumar" <Sankarakumar(dot)Ramalingam(at)elavon(dot)com> |
---|---|
To: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: postgres standby won't start |
Date: | 2015-10-08 15:27:58 |
Message-ID: | C7BCCAFB121E934BA4FE0D9790294D57AD5F0036@SPPATLXCHMBX01.servers.global.prv |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Yes it is and Yes I do have the recovery file.
Here is the scenario. It looks like the logs are not getting shipped over to the standby. After I dragged the WAL files from Primary to Standby and restarted, I see some successful recovery messages with the file names mentioned. Right now the standby is now functional as READ ONLY.
One question would be why logs are not getting shipped to standby even though my log say connection to primary successful.
Another question, if I have to make it a standalone DB instead of standby, now that I have the required data in place, what changes I need to do in Primary as well as here.
Thanks a lot for your continuous response.
P.S. I did use pg_basebackup and moved the tar file to standby and overwrote (after cleaning up data folder) the data folder and then started the db
Thanks
Kumar Ramalingam
X6015288
-----Original Message-----
From: Adrian Klaver [mailto:adrian(dot)klaver(at)aklaver(dot)com]
Sent: Thursday, October 08, 2015 9:31 AM
To: Ramalingam, Sankarakumar; pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] postgres standby won't start
On 10/07/2015 10:01 PM, Ramalingam, Sankarakumar wrote:
> Hi Adrian,
> After a few attempts I used the following (without method=stream as it
> is not working on 9.1) and restored the DB on standby site
> successfully. The log says it is connecting to primary streaming
> replication successfully connected to primary
>
> but still complains about some log files.
>
> 2015-10-08 00:47:37 EDT LOG: streaming replication successfully
> connected to primary
> 2015-10-08 00:53:53 EDT LOG: received smart shutdown request
> 2015-10-08 00:53:53 EDT FATAL: terminating walreceiver process due to
> administrator command
> 2015-10-08 00:53:53 EDT LOG: shutting down
> 2015-10-08 00:53:53 EDT LOG: database system is shut down
> 2015-10-08 00:54:04 EDT LOG: database system was shut down in
> recovery at 2015-10-08 00:53:53 EDT
> cp: cannot stat `/db_logs/pgsql/archive/0000001A.history': No such
> file or directory
> 2015-10-08 00:54:04 EDT LOG: entering standby mode
> cp: cannot stat `/db_logs/pgsql/archive/0000001A00000845000000C9': No
> such file or directory
> 2015-10-08 00:54:04 EDT LOG: redo starts at 845/C9000020
> 2015-10-08 00:54:04 EDT LOG: consistent recovery state reached at
> 845/CA000000
> 2015-10-08 00:54:04 EDT LOG: database system is ready to accept read
> only connections
> cp: cannot stat `/db_logs/pgsql/archive/0000001A00000845000000CA': No
> such file or directory
> 2015-10-08 00:54:04 EDT LOG: streaming replication successfully
> connected to primary
> 2015-10-08 00:56:21 EDT LOG: connection received: host=[local]
> 2015-10-08 00:56:21 EDT LOG: connection authorized: user=postgres
> database=clients
So what is '/db_logs/pgsql/archive/'?
For the moment I going to guess it is a WAL archive location. If so, do you have a recovery.conf on the standby and an restore_command in it that points to that location?
>
>
> Thanks
> Kumar Ramalingam
> X6015288
>
>
> -----Original Message-----
> From: Adrian Klaver [mailto:adrian(dot)klaver(at)aklaver(dot)com]
> Sent: Wednesday, October 07, 2015 8:06 PM
> To: Ramalingam, Sankarakumar; pgsql-general(at)postgresql(dot)org
> Subject: Re: [GENERAL] postgres standby won't start
>
> On 10/07/2015 01:30 PM, Ramalingam, Sankarakumar wrote:
>> Hello Adrian,
>> Can I use this command so that all the data is streamed directly to the target. Target is pretty much unusable now. Should I 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
>
> Just to be sure the target is the standby server, correct?
>
> If so you do not want this:
>
> -h <my target hostname>
>
> -h is for the server you are taking the backup of, or to put it another way the flow is from -h to -D.
>
> If you are running pg_basebackup on the same machine as the primary then:
>
> pg_basebackup -D <my target host directory> -P -U replication --xlog-method=stream
>
> This assumes there is only one instance of Postgres running on that machine and it is running on port 5432. If not then you will need to specify -p <correct_port>
>
> pg_basebackup is a client program, so like other such programs you have to tell it what database(cluster) to connect to using the normal switches, see below. Actually pg_basebackup does not connect to a specific database but to the database cluster, so any database name you supply will be ignored.
>
> http://www.postgresql.org/docs/9.4/interactive/app-pgbasebackup.html
>
> "The following command-line options control the database connection parameters."
>
>>
>>
>>
>> Thanks
>> Kumar Ramalingam
>> X6015288
>>
>>
>
>
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com
> The information contained in this e-mail and in any attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. This message has been scanned for known computer viruses.
>
>
--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com
The information contained in this e-mail and in any attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. This message has been scanned for known computer viruses.
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2015-10-08 17:54:39 | Re: dubious optimization of the function in SELECT INTO target list |
Previous Message | Adrian Klaver | 2015-10-08 14:00:31 | Re: dubious optimization of the function in SELECT INTO target list |