Setting up a warm standby server - some questions - Mailing list pgsql-admin

From Thomas Kellerer
Subject Setting up a warm standby server - some questions
Date
Msg-id i1mnd7$9gk$1@dough.gmane.org
Whole thread Raw
Responses Re: Setting up a warm standby server - some questions  (Thomas Kellerer <spam_eater@gmx.net>)
List pgsql-admin
Hi,

I'm trying to setup a warm standby server. But there are some things that I don't yet understand.
I'm testing this on my windows box to understand the concepts and while waiting for the real hardware ;)

I got the basic setup working, and a simulated failover was working, but some things are unclear to me:


What is the recommended way to switch back to the primary, once that is up and running again?

Especially assuming that data has been changed on the secondar?
Can I do a base backup of the data directory (after running pg_start_backup()) from the secondary to the primary?


What is the recommended way to get the secondary back into the "standby" mode?
Currently I simply shut it down, rename recovery.done to recovery.conf and start it up again.
Is this allright?

In the logfile that is written by pg_standby I can see some "errors" and I'm not sure if that's OK.

My recovery.conf looks like this:

restore_command = 'c:\Projects\pgtest\standby\server\bin\pg_standby.exe -l -d -s 2 -k 50 -t
c:\Projects\pgtest\standby\pgsql.triggerc:\Projects\pgtest\archive %f %p %r >>c:\Projects\pg\standby\standby.log 2>&1' 

Which is essentially copied from the manual and seems to be working.
However in the standby.log I can see messages like this:

Command for restore    : copy "c:\Projects\pg\archive\00000003.history" "pg_xlog\RECOVERYHISTORY"
Keep archive history    : 000000000000000000000000 and later
running restore        :The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
not restored
history file not found

The "cannot find the file" or "history file not found" do not look right to me.

Although I also see "success" messages in there, like:
running restore        :        1 file(s) copied.
  OK

So what should I do about the error messages?


I have also problems shutting down the secondary server while it is in "standby" (i.e. recovery) mode
If I use "pg_ctl stop" it never shuts down.
If I use "pg_ctl stop -m immediate" most of the postgres processes terminate, but the one that spawned the pg_standby
processwill linger around. 
What am I missing here?


Thanks a lot in advance
Thomas

pgsql-admin by date:

Previous
From: Karma Bhutia
Date:
Subject: Urgent - MySQL Postgres DBA - CA
Next
From: Silvio Brandani
Date:
Subject: postgres data permission