Setting up a warm standby server - some questions

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-admin(at)postgresql(dot)org
Subject: Setting up a warm standby server - some questions
Date: 2010-07-15 10:20:23
Message-ID: i1mnd7$9gk$1@dough.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.trigger c:\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 process will linger around.
What am I missing here?

Thanks a lot in advance
Thomas

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Silvio Brandani 2010-07-15 13:06:56 postgres data permission
Previous Message Karma Bhutia 2010-07-15 07:28:32 Urgent - MySQL Postgres DBA - CA