J'ai une configuration d'expédition WAL qui fonctionne avec un serveur esclave de secours chaud appliquant les fichiers WAL. Lorsque je crée le fichier de trigger pg_standby, il le détecte immédiatement, mais il faut environ 10 à 15 minutes pour être prêt à accepter les connexions. La plupart du temps on passe à attendre des fichiers .history.Postgresql pg_standby prend une éternité pour effectuer un basculement
Le fichier de trigger est vide, un basculement "intelligent" doit donc être effectué. Puis-je faire quelque chose pour accélérer (beaucoup) le basculement?
sortie du journal:
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
Merci.
-Dennis
Je connais le basculement rapide ou intelligent. Nous utilisons «intelligent» à dessein. Mais il n'y a aucune activité sur le serveur maître, et rien dans le répertoire d'archives WAL pour lire et appliquer. Si l'on se fie au journal, les fichiers sont attendus longtemps, même si la restauration «intelligente» devrait simplement appliquer les fichiers WAL disponibles, si je comprends bien. Au moins, je considère que 10-15 minutes est trop long lorsqu'il n'y a pas de fichiers WAL à appliquer. –