2014 shaares
45 private links
45 private links
Vérif de réplication :
sur le master :
select * from pg_stat_replication;
sur le slave :
SELECT
CASE
WHEN pg_last_xlog_receive_location() = pg_last_xlog_replay_location() THEN 0
ELSE EXTRACT (EPOCH FROM now() - pg_last_xact_replay_timestamp())::INTEGER
END
AS replication_lag;
(0 si tout va bien sinon secondes de délai)
ou
select pid, client_addr, state, sync_state,
pg_xlog_location_diff(sent_location, write_location) as write_lag,
pg_xlog_location_diff(sent_location, flush_location) as flush_lag,
pg_xlog_location_diff(sent_location, replay_location) as replay_lag
from pg_stat_replication ;
To pause, run the following query on the slave server:
select pg_xlog_replay_pause();
To resume, run
select pg_xlog_replay_resume();
à compléter.