Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 4A4EA632AFB for ; Thu, 15 Jul 2010 07:20:44 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 35314-02 for ; Thu, 15 Jul 2010 10:20:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id 7607D632807 for ; Thu, 15 Jul 2010 07:20:35 -0300 (ADT) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OZLYO-0002gO-Dc for pgsql-admin@postgresql.org; Thu, 15 Jul 2010 12:20:32 +0200 Received: from 217.110.94.67 ([217.110.94.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Jul 2010 12:20:32 +0200 Received: from spam_eater by 217.110.94.67 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Jul 2010 12:20:32 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-admin@postgresql.org From: Thomas Kellerer Subject: Setting up a warm standby server - some questions Date: Thu, 15 Jul 2010 12:20:23 +0200 Lines: 53 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 217.110.94.67 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.746 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_NUMERIC_HELO=1.164, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201007/83 X-Sequence-Number: 35102 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