2012-02-03 196 views
1

我是从Postgres的9.0.4(红帽)到9.0.6(fedoara14) 执行日志传送,但我收到一条错误日志传送错误的Postgres

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' 

当我从删除的recovery.conf文件数据/目录 和postgresql.conf文件关闭“hot_standby”,那么我就可以开始Postgres的,可以选择数据 我想次要的Postgres应该在hot_standby模式

可以启动任何一个可以告诉我如何摆脱这个问题!

回答

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. 

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

事实上,为了保持待机状态,您需要archivehot_standby水平的WAL,每documentation

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