Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id E595F9FBB36 for ; Wed, 4 Apr 2007 11:15:31 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 22663-04 for ; Wed, 4 Apr 2007 11:15:10 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by postgresql.org (Postfix) with ESMTP id 183679FBA81 for ; Wed, 4 Apr 2007 11:15:16 -0300 (ADT) Received: from root by ciao.gmane.org with local (Exim 4.43) id 1HZ6GM-0000hK-SU for pgsql-admin@postgresql.org; Wed, 04 Apr 2007 16:15:02 +0200 Received: from static-87-79-236-37.netcologne.de ([87.79.236.37]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Apr 2007 16:15:02 +0200 Received: from dl by static-87-79-236-37.netcologne.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Apr 2007 16:15:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-admin@postgresql.org From: Damian Lubosch Subject: Hot Backup using WAL files Date: Wed, 04 Apr 2007 15:53:57 +0200 Lines: 77 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: static-87-79-236-37.netcologne.de User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/29 X-Sequence-Number: 25093 Hello! I already searched in the archives for similar problems but didn't find any. I want to have a hot backup server of my master server's database. I am using NetBSD 3.0.1 with Postgresql 8.2.3. It works so far, that I receive the WAL Files on the slave every few minutes from the master. I have a small Script that rebuilds the slave server with master's data and feeds it with the WAL files that appeared since then: (I am doing a binary backup of the master with a perl script from http://pgfoundry.org/frs/?group_id=1000253 ) Script on the slave: # Source www.postgresqlforums.com/wiki/Backup_&_Recovery # Adjusted by Damian dl@xiqit.de PGDIR=/var/databases/pgsql /etc/rc.d/pgsql stop cp -Rp $PGDIR/data/pg_xlog /tmp rm -fR $PGDIR/data umask 077 su pgsql -c "mkdir -p $PGDIR/data/pg_xlog/archive_status" # get newest binary backup FILE=`ls -t $PGDIR/bak/pg* | head -1` cd $PGDIR/data gzip -dc $FILE | tar xpf - cp -Rp /tmp/pg_xlog/* $PGDIR/data/pg_xlog su pgsql -c "cp $PGDIR/recovery.done $PGDIR/data/recovery.conf" su pgsql -c "cp $PGDIR/postgresql.conf $PGDIR/data/postgresql.conf" /etc/rc.d/pgsql start rm -fR /tmp/pg_xlog My problem now is, how to continually feed the slave server with new received WAL files? The slave just restores up to the state when I ran my script. I also tried to stop the server rename recovery.done to recovery.conf and start the server again (without deleting anything). It looks in the received WAL files' directory and complains about some errors, but starts after that. I am worried about the errors.