Replication Monitoring
Monitor replication health via SHOW REPLICA STATUS and Performance Schema tables. Set up alerts on lag and thread status.
Monitor replication health via SHOW REPLICA STATUS and Performance Schema tables. Set up alerts on lag and thread status.
-- Key SHOW REPLICA STATUS fields:
-- Replica_IO_Running: Yes (fetching binlog)
-- Replica_SQL_Running: Yes (applying events)
-- Seconds_Behind_Source: 0 (no lag)
-- Last_Error: "" (no error)
-- Performance Schema:
SELECT * FROM performance_schema.replication_connection_status\G
SELECT * FROM performance_schema.replication_applier_status\G
-- Alert on lag > 10s, IO/SQL thread not running, or errors
Both IO and SQL threads must be running (Yes) — if either is No, replication has stopped.