Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 23D499F9978 for ; Fri, 24 Aug 2007 01:18:20 -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 21260-03 for ; Fri, 24 Aug 2007 01:18:16 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.232]) by postgresql.org (Postfix) with ESMTP id F276B9F9BA3 for ; Fri, 24 Aug 2007 01:18:15 -0300 (ADT) Received: by wx-out-0506.google.com with SMTP id r21so636044wxc for ; Thu, 23 Aug 2007 21:18:15 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=d3qOS9Vc21E7jZ2UxehF0NzVbz3KNPF9oYsTu0m926EOAmN5KCin16f8zNNVboL/5WDK9Dr1fWx4GI4AAKRqZ3BbBjzyXoH+feTUkrSBUxLl86vOGscBXZ2bCLnttZJcrQzhpCp6rWN+BVGPbNeQEixTam5NxzZhgQYO5LX1KnI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=WBAUuRlDcmDL9A1KGw/Nye7TG1/IKNYROPnCg2XekfkKzKhm04/MtaFFnZFK9NWgKrNULjdSFu0Zwo/lrfBRz89gnwLmZRQZKdEjLTk/O7coxhGkyYLL3ZhCphMc/wE8nQBXq0egZb6P3tukhjNJnjERqJTJXjEZKMLalaaYZeQ= Received: by 10.70.69.2 with SMTP id r2mr4254037wxa.1187929092421; Thu, 23 Aug 2007 21:18:12 -0700 (PDT) Received: by 10.70.56.5 with HTTP; Thu, 23 Aug 2007 21:18:12 -0700 (PDT) Message-ID: <2ca799770708232118u52498eefv702f950b217c14a5@mail.gmail.com> Date: Fri, 24 Aug 2007 07:18:12 +0300 From: "Mikko Partio" To: "Kenji Morishige" Subject: Re: Warm-Backup configuration question Cc: pgsql-admin@postgresql.org In-Reply-To: <20070823235452.GE20953@juniper.net> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_133025_10423920.1187929092318" References: <20070823235452.GE20953@juniper.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/310 X-Sequence-Number: 26641 ------=_Part_133025_10423920.1187929092318 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/24/07, Kenji Morishige wrote: > > 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. > > > Why don't you just use pg_standby from contrib. Regards MP ------=_Part_133025_10423920.1187929092318 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline

On 8/24/07, Kenji Morishige <kenjim@juniper.net> wrote:
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.



Why don't you just use pg_standby from contrib.

Regards

MP
------=_Part_133025_10423920.1187929092318--