Problems in PITR backup&recovery - Mailing list pgsql-general

From Andrea
Subject Problems in PITR backup&recovery
Date
Msg-id 47FF4E52.8040101@comune.modena.it
Whole thread Raw
List 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

pgsql-general by date:

Previous
From: "Jaisen N.D."
Date:
Subject: Problem. createdb: could not connect to database postgres: could not connect to server: No such file or directory
Next
From: Andrew Falanga
Date:
Subject: Re: How does psql actually implement the \d commands