日志运送错误postgres

时间:2012-02-03 03:54:46

标签: postgresql

我正在执行从postgres 9.0.4(redhat)到9.0.6(fedoara14)的日志传送 但是我收到了一个错误

HINT:  If this has occurred more than once some data might be corrupted and you might need to choose an earlier recovery target.
LOG:  entering standby mode
LOG:  restored log file "000000010000000200000065" from archive
LOG:  record with zero length at 2/65000100
WARNING:  WAL was generated with wal_level=minimal, data may be missing
HINT:  This happens if you temporarily set wal_level=minimal without taking a new base backup.
FATAL:  hot standby is not possible because wal_level was not set to "hot_standby" on the master server
HINT:  Either set wal_level to "hot_standby" on the master, or turn off hot_standby here.
LOG:  startup process (PID 9438) exited with exit code 1
LOG:  aborting startup due to startup process failure

ls ../archive/
000000010000000200000051                  000000010000000200000059                  00000001000000020000005F.00000020.backup
000000010000000200000052                  000000010000000200000059.00000020.backup  000000010000000200000060
000000010000000200000053                  00000001000000020000005A                  000000010000000200000061
000000010000000200000054                  00000001000000020000005B                  000000010000000200000061.00000020.backup
000000010000000200000055                  00000001000000020000005B.00000020.backup  000000010000000200000062
000000010000000200000055.00000020.backup  00000001000000020000005C                  000000010000000200000063
000000010000000200000056                  00000001000000020000005D                  000000010000000200000064
000000010000000200000057                  00000001000000020000005E                  000000010000000200000065
000000010000000200000058                  00000001000000020000005F         


ls pg_xlog
000000010000000200000061.00000020.backup  000000010000000200000067  00000001000000020000006A  archive_status
000000010000000200000065                  000000010000000200000068  00000001000000020000006B  RECOVERYXLOG
000000010000000200000066                  000000010000000200000069  00000001000000020000006C


cat recovery.conf 
### RECOVERY 
standby_mode = 'on'
restore_command = 'cp -i  /var/lib/pgsql/9.0/archive/%f %p'

当我从data /目录中删除recovery.conf文件时 并在postgresql.conf文件中关闭'hot_standby'然后我可以启动postgres并可以选择数据 我希望辅助postgres应该以hot_standby模式启动

任何人都可以告诉我如何摆脱这个问题!!!

1 个答案:

答案 0 :(得分:1)

请检查主数据库上的postgresql.conf。根据你的日志:

WARNING:  WAL was generated with wal_level=minimal, data may be missing
HINT:  This happens if you temporarily set wal_level=minimal without taking a new base backup.
FATAL:  hot standby is not possible because wal_level was not set to "hot_standby" on the master server
HINT:  Either set wal_level to "hot_standby" on the master, or turn off hot_standby here.

该消息非常有用。您应该在master数据库上使用wal_level = hot_standby(考虑在启用后运行完整备份),或者在备用端使用hot_standby = off(此更改不需要额外的操作)。

事实上,为了维持待机状态,您需要archivehot_standby级别的WAL,每documentation

如果您已通过删除recovery.conf并启动群集来激活备用数据库,那么您应该从最新的完整备份重新创建备用数据库。