From: | "Adam Groves" <adam(dot)groves(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | PITR and WAL archiving |
Date: | 2007-03-13 22:37:22 |
Message-ID: | 1173825442.382414.310570@o5g2000hsb.googlegroups.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
I have been ramming my head against the wall for the past two
evenings, trying to get PITR working and it's gotten to the point
where I need to ask someone for help.
I'm basically trying to follow the instructions in the manual in
chapter 23.3.
Here's how I'm starting out:
===================
Contents of 'data':
PG_VERSION
base
global
pg_clog
pg_hba.conf
pg_ident.conf
pg_multixact
pg_subtrans
pg_tblspc
pg_twophase
pg_xlog
postgresql.conf
postmaster.opts
data/pg_xlog/archive_status is empty.
I have the following line in postgresql.conf:
archive_command = 'cp -i %p /mnt/server/archive/wal/%f < /dev/null'
/mnt/server/archive/wal is empty.
Here's my procedure:
===============
1. pg_ctl start -l logfile
2. SELECT pg_start_backup('label');
3. tar -zcf /mnt/server/archive/file/backup.tar.gz . (the contents of
'data')
4. SELECT pg_stop_backup();
5. pg_ctl stop
6. I now delete the contents of 'data' (making a copy before hand)
7. In 'data': tar xzvf /mnt/server/archive/file/backup.tar.gz
8. echo \"restore_command = 'cp /mnt/server/archive/wal/%f %p'\" >
recovery.conf
9. pg_ctl start -l logfile
And here are the logs:
================
LOG: database system was shut down at 2007-03-13 23:07:33 CET
LOG: checkpoint record is at 0/1E000020
LOG: redo record is at 0/1E000020; undo record is at 0/0; shutdown
TRUE
LOG: next transaction ID: 0/161203; next OID: 17156
LOG: next MultiXactId: 1; next MultiXactOffset: 0
LOG: database system is ready
LOG: received smart shutdown request
LOG: shutting down
LOG: database system is shut down
LOG: database system was shut down at 2007-03-13 23:09:21 CET
LOG: checkpoint record is at 0/1E000068
LOG: redo record is at 0/1E000068; undo record is at 0/0; shutdown
TRUE
LOG: next transaction ID: 0/161203; next OID: 17156
LOG: next MultiXactId: 1; next MultiXactOffset: 0
LOG: database system is ready
LOG: database system was interrupted at 2007-03-13 23:11:21 CET
LOG: starting archive recovery
LOG: restore_command = "cp /mnt/server/archive/wal/%f %p"
cp: /mnt/server/archive/wal/00000001.history: No such file or
directory
LOG: restored log file "00000001000000000000001E.000000B0.backup"
from archive
LOG: restored log file "00000001000000000000001E" from archive
LOG: checkpoint record is at 0/1E0000B0
LOG: redo record is at 0/1E0000B0; undo record is at 0/0; shutdown
FALSE
LOG: next transaction ID: 0/161205; next OID: 17156
LOG: next MultiXactId: 1; next MultiXactOffset: 0
LOG: automatic recovery in progress
LOG: redo starts at 0/1E0000F8
cp: /mnt/server/archive/wal/00000001000000000000001F: No such file or
directory
LOG: could not open file "pg_xlog/00000001000000000000001F" (log file
0, segment 31): No such file or directory
LOG: redo done at 0/1E0000F8
LOG: restored log file "00000001000000000000001E" from archive
LOG: archive recovery complete
LOG: database system is ready
LOG: received smart shutdown request
LOG: shutting down
LOG: database system is shut down
LOG: database system was shut down at 2007-03-13 23:17:32 CET
LOG: checkpoint record is at 0/1F000068
LOG: redo record is at 0/1F000068; undo record is at 0/0; shutdown
TRUE
LOG: next transaction ID: 0/161207; next OID: 17156
LOG: next MultiXactId: 1; next MultiXactOffset: 0
LOG: database system is ready
overwrite /mnt/server/archive/wal/00000001000000000000001E? (y/n [n])
not overwritten
LOG: archive command "cp -i pg_xlog/00000001000000000000001E /mnt/
server/archive/wal/00000001000000000000001E < /dev/null" failed:
return code 256
Where oh where might I be going wrong? I'd be grateful for any
suggestions.
Regards
Adam
From | Date | Subject | |
---|---|---|---|
Next Message | Joshua D. Drake | 2007-03-13 23:50:46 | Re: orphaned PGDATA/base/ subdirectories |
Previous Message | Reece Hart | 2007-03-13 22:32:55 | Re: orphaned PGDATA/base/ subdirectories |