Problems in PITR backup&recovery

From: Andrea <arussos(at)comune(dot)modena(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: Problems in PITR backup&recovery
Date: 2008-04-11 11:41:06
Message-ID: 47FF4E52.8040101@comune.modena.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all, i'm trying to setup PITR on my postgresql ( i run version 1.8.11 );
Following the docs and tips from the list this is what i made:

1) set up a crontab which copys the last-created WAL file in
/home/postgres/WAL
2) set up a shell-script as a the archive_command: it copyes WAL files
from pg_xlog dir in /home/postgres/WAL
3) set up a shell script for doing the backup. It connects to DB and
then issues "SELECT pg_start_backup('full-bck');" , then it execute "tar
--exclude data/pg_xlog -cvzpf archive.tar.gz data" , and finally "SELECT
pg_stop_backup();".

For testing purposes i use another server in which i installed the same
version of PostgreSQL. In it i deleted the DATA dir (
/var/lib/pgsql/data ); then i unpacked the archive.tar.gz ; i created
the pg_xlog dir and, in it, also the archive_status one.
I setup the recovery.conf whit the recovery_command='cp
/home/postgres/WAL/%f "%p"' . I copied all the WAL files fron the
old-server to the new one in /home/postgres/WAL/.

When i try to start the DB it hangsup saying ( in the logs ):
.....
LOG: database system was interrupted at 2008-04-11 09:03:48 CEST
LOG: starting archive recovery
LOG: restore_command = "cp /home/postgres/WAL/%f %p"
cp: cannot stat `/home/postgres/WAL/00000001.history': No such file or
directory
LOG: restored log file "00000001000000010000006A" from archive
LOG: unexpected pageaddr 1/602B2000 in log file 1, segment 106, offset
2826240
LOG: invalid primary checkpoint record
LOG: restored log file "00000001000000010000006A" from archive
LOG: unexpected pageaddr 1/60280000 in log file 1, segment 106, offset
2621440
LOG: invalid secondary checkpoint record
PANIC: could not locate a valid checkpoint record
LOG: startup process (PID 22672) was terminated by signal 6
LOG: aborting startup due to startup process failure
LOG: logger shutting down
.....

Someone can help in understanding where is the problems ???

Thanks in advance,

--Andrea

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2008-04-11 11:45:06 Re: How does psql actually implement the \d commands
Previous Message Raymond O'Donnell 2008-04-11 10:40:50 Re: PostgresSQL on a networked drive with multiple users