2012-02-03 8 views
1

Iは、9.0.6(fedoara14) へ9.0.4(RedHatの)のPostgresからログ配布を行っていたが、私はからrecovery.confのファイルを削除するとき、私はエラーログ配布エラーの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' 

を受けデータ/ディレクトリ と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を使用する必要があります(この変更には余分な操作は必要ありません)。

実際、スタンバイを維持するには、documentationあたりarchiveまたはhot_standbyレベルのWALが必要です。

recovery.confを削除してクラスタを起動してスタンバイを有効にした場合は、最新のフルバックアップからスタンバイを再作成する必要があります。