Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

Monitoring Streaming Replication Lag - Postgres 9.2

$
0
0

I have some Slaves running with Streaming Replication, and would like to monitor the streaming replication.

I'm currently using these queries:

On master:

SELECT client_hostname
    , client_addr
    , pg_xlog_location_diff(pg_stat_replication.sent_location, pg_stat_replication.replay_location) AS byte_lag 
FROM pg_stat_replication

On slave:

select now() - pg_last_xact_replay_timestamp() AS replication_delay;

Is there any way I can create a table and put this data into it? Every minute?

I could create a PL/PGSQL function but, how to make it run every minute?


Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>