Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id A00489F994A for ; Thu, 23 Aug 2007 20:54:57 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 62804-06 for ; Thu, 23 Aug 2007 20:54:54 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from smtpa.juniper.net (smtpa.juniper.net [207.17.137.120]) by postgresql.org (Postfix) with ESMTP id 870179F9AAB for ; Thu, 23 Aug 2007 20:54:54 -0300 (ADT) Received: from unknown (HELO magenta.juniper.net) ([172.17.27.123]) by smtpa.juniper.net with ESMTP/TLS/DES-CBC3-SHA; 23 Aug 2007 16:54:53 -0700 X-IronPort-AV: i="4.19,302,1183359600"; d="scan'208"; a="65145202:sNHT34419524" Received: from kenjim-lnx.juniper.net (kenjim-lnx.juniper.net [172.17.58.60]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id l7NNsqS42616; Thu, 23 Aug 2007 16:54:52 -0700 (PDT) (envelope-from kenjim@juniper.net) Received: from kenjim-lnx.juniper.net (kenjim-lnx.juniper.net [127.0.0.1]) by kenjim-lnx.juniper.net (8.13.7/8.13.7) with ESMTP id l7NNsqK1025448; Thu, 23 Aug 2007 19:54:52 -0400 Received: (from kenjim@localhost) by kenjim-lnx.juniper.net (8.13.7/8.13.7/Submit) id l7NNsqwb025447; Thu, 23 Aug 2007 19:54:52 -0400 Date: Thu, 23 Aug 2007 19:54:52 -0400 From: Kenji Morishige To: pgsql-admin@postgresql.org Cc: kenjim@juniper.net Subject: Warm-Backup configuration question Message-ID: <20070823235452.GE20953@juniper.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/305 X-Sequence-Number: 26636 I've got 2 identical servers configured exactly the same way, except for some minor differences for the WAL logging directories. I have both machines set up as a NFS server and client, so that the WAL archive gets written out to the local filesystem of the backup machine depending on which role the machine is currently configured for. I've been able to get the backup server syncronized by using the recover.conf file as described in the documenation, but I can't seem to write a generic shell script that will keep the warm-backup in a continously syncronizing mode. It always stops and renames the recover.conf to recover.done. I've tried to write an alternate restore command as follows: #!/usr/local/bin/bash if [ -e /export/raid/pgsql/recovery.stop ]; then exit 1 fi if [ -e $1 ]; then `/bin/cp $1 $2` fi sleep 5 exit 0 The documenation says that it should return 0 only if it is successfull. My understanding is that the recovery script should continuously try to copy the archived data to the WAL directory so that the WARM-BACKUP server can syncronize. I'd like to have the WARM-BACKUP always be only a few minutes behind in syncronization from the PRIMARY without human intervention. I can write a cronjob to clean out the WAL archive directory accordingly. I would be extremely gratefull for any assistance from anyone with a similar configuration. I must be confused by how the restore_command is supposed to work. Sincerely, Kenji