2

WALファイルを適用するウォームスタンバイスレーブサーバーを備えたWAL出荷セットアップが機能しています。

pg_standby トリガー ファイルを作成すると、すぐに検出されますが、実際に接続を受け入れる準備が整うまでに 10 ~ 15 分ほどかかります。ほとんどの時間は、.history ファイルの待機に費やされます。

トリガー ファイルが空であるため、「スマート」フェイルオーバーを実行する必要があります。フェイルオーバーを (はるかに) 高速化するために何かできることはありますか?

ログ出力:

WAL file not present yet. Checking for trigger file...
trigger file found: smart failover
LOG:  could not open file "pg_xlog/000000010000000000000089" (log file 0, segment 137): No such file or directory
LOG:  redo done at 0/88003428
LOG:  last completed transaction was at log time 2010-08-10 13:26:20.232799+00
Trigger file        : /psql_archive/role.master
Waiting for WAL file    : 000000010000000000000088
WAL file path       : /psql_archive/000000010000000000000088
Restoring to        : pg_xlog/RECOVERYXLOG
Sleep interval      : 60 seconds
Max wait interval   : 0 forever
Command for restore : cp "/psql_archive/000000010000000000000088" "pg_xlog/RECOVERYXLOG"
Keep archive history    : 000000000000000000000000 and later
trigger file found: smart failover
running restore     : OK

LOG:  restored log file "000000010000000000000088" from archive
Trigger file        : /psql_archive/role.master
Waiting for WAL file    : 00000002.history
WAL file path       : /psql_archive/00000002.history
Restoring to        : pg_xlog/RECOVERYHISTORY
Sleep interval      : 60 seconds
Max wait interval   : 0 forever
Command for restore : cp "/psql_archive/00000002.history" "pg_xlog/RECOVERYHISTORY"
Keep archive history    : 000000000000000000000000 and later
running restore     :cp: cannot stat `/psql_archive/00000002.history': No such file or directory
cp: cannot stat `/psql_archive/00000002.history': No such file or directory
cp: cannot stat `/psql_archive/00000002.history': No such file or directory
cp: cannot stat `/psql_archive/00000002.history': No such file or directory
not restored
history file not found
LOG:  selected new timeline ID: 2
Trigger file        : /psql_archive/role.master
Waiting for WAL file    : 00000001.history
WAL file path       : /psql_archive/00000001.history
Restoring to        : pg_xlog/RECOVERYHISTORY
Sleep interval      : 60 seconds
Max wait interval   : 0 forever
Command for restore : cp "/psql_archive/00000001.history" "pg_xlog/RECOVERYHISTORY"
Keep archive history    : 000000000000000000000000 and later
running restore     :cp: cannot stat `/psql_archive/00000001.history': No such file or directory
cp: cannot stat `/psql_archive/00000001.history': No such file or directory
cp: cannot stat `/psql_archive/00000001.history': No such file or directory
cp: cannot stat `/psql_archive/00000001.history': No such file or directory
not restored
history file not found
LOG:  archive recovery complete
LOG:  autovacuum launcher started
LOG:  database system is ready to accept connections

ありがとう。

-デニス

4

2 に答える 2

1

要するに、高速フェイルオーバーを使用しない場合、pg_standby はデータの損失を最小限に抑えるために (当然のことながら) 残っているすべてのログを処理し続けます。

あなたの人生を楽にするために、私はPITRToolsを見ます.

于 2010-08-11T16:53:52.290 に答える
0

ドキュメントによると:http://www.postgresql.org/docs/current/static/pgstandby.html

高速フェイルオーバー: 高速フェイルオーバーでは、サーバーはすぐに起動します。まだ適用されていないアーカイブ内の WAL ファイルは無視され、それらのファイル内のすべてのトランザクションは失われます。高速フェイルオーバーをトリガーするには、トリガー ファイルを作成し、fast という単語を書き込みます。pg_standby は、定義された間隔内に新しい WAL ファイルが表示されない場合に、高速フェイルオーバーを自動的に実行するように構成することもできます。

または、「表 F-23. pg_standby オプション」を調べてください。maxwaittime が記述されています。

乾杯

于 2010-08-11T14:46:13.373 に答える