Monitoring Replication

Currently, VividCortex supports monitoring replication for MySQL.

VividCortex can use values collected from SHOW SLAVE STATUS to reconstruct the replication topology and track replication issues. Therefore replication monitoring typically requires no extra configuration by the user. However, this method does require that the server id (from SELECT @@server_id) is unique across the entire infrastructure so that it can differentiate between the database hosts.

If your infrastructure has multiple hosts with the same server id, then replication monitoring is still possible using the “heartbeat” approach. Here, VividCortex uses an auxiliary heartbeat table to reconstruct the replication topology by tracking sample data as it is replicated through the servers. If you wish to use this approach, you must create a vividcortex.heartbeat table on each server you wish to monitor, and you must give the agent user permission to access that table.

Here are the necessary statements to create ‘vividcortex.heartbeat’:

CREATE DATABASE vividcortex;
CREATE TABLE vividcortex.heartbeat (
  server_id int unsigned NOT NULL PRIMARY KEY,
  host_id int unsigned NOT NULL,
  ts double NOT NULL
);

The necessary privileges are as follows:

GRANT SELECT, INSERT, UPDATE ON vividcortex.heartbeat TO vividcortex@'%';

If for some reason you wish to use a database and table name different from vividcortex.heartbeat then contact us and we will help you set this up.

Additionally, you will need to include in the config file for vc-mysql-metrics the setting “repl-heartbeat”:true. For more information on config files, refer to our Configuration documentation.

Setting up an Alert

Using the Alerts page, you can be notified if the replication delay becomes too large. To do this, set up a threshold alert triggered on the metric mysql.status.replication_delay_us. This is measured in microseconds, so a replication delay of “25 seconds” would be entered as “25000000.” Follow the instructions on the Alerts page for more details of setting up alerts, and do not hesitate to contact us with any questions.