wiki:HowMySQLMonkWorks

How doe MySQL Monk works

Uppon first run, MySQL Monk creates a simple table called mysql_monk in the replicated database.

mysql> describe mysql_monk;
+-------------+----------+------+-----+---------+-------+
| Field       | Type     | Null | Key | Default | Extra |
+-------------+----------+------+-----+---------+-------+
| master_id   | int(11)  | NO   | PRI | NULL    |       |
| last_update | datetime | NO   |     | NULL    |       |
+-------------+----------+------+-----+---------+-------+
  • For each master, MySQL Monk updates the timestamp in that table periodically (as defined in mysql_monk.monitor.update_interval).
  • For each slave, it checks if if the timestamp on the slave is close enough to the timestamp on the master periodically (as defined in mysql_monk.monitor.check_interval)
  • if the timestamp difference is greated than in mysql_monk.monitor.max_allowed_lag, and event is raised (which usually results in an email being sent).
  • if the timestamp difference was greater than the max allowed lag, and the situation is resolved, another email is sent - indicating that all is well again.
  • if a server cannot be contacted (crashed? just turned off?), and email is sent. if it comes back online, an email is sent.
Last modified 10 years ago Last modified on Aug 12, 2009, 8:06:24 PM