Mysql monitoring using InfluxDB and Collectd

mysql-monitoring-using-influxdb

In this article we will explain how to setup mysql monitoring using InfluxDB and “Collectd

Mysql is the worlds most popular opensource RDMS database. With its proven performance, reliability, and ease-of-use, It has become the most preferred database choice for web-based applications.

In production Mysql installations, it is critical to monitor the mysql performance and traffic , this will help us to find the bottlenecks, identify potential performance issues and make decisions on scaling.

How to monitor mysql using InfluxDB and Collectd ?

We will explain how to setup a simple monitoring stack which consists of following components

1. Collectd
2. InfluxDB
3. Grafana

Collectd” is a daemon which collects system and application performance metrics periodically and provides ways to send the metrics data to variety of datastores like Graphite, InfluxDB..

How to install and Configure Collectd?

On Centos , you can install Collectd using yum

On Ubuntu , you can install collectd using “apt-get”

Now let us configure collectd to collect the mysql performance and statistics metrics .

First create a mysql user on your mysql server

Now Modify “collectd” configuration and add the mysql server details like following

Now configure collectd to send metrics data to InfluxDB

By default InfluxDB will accept metrics from collectd on UDP port 25836 . Now we configured collectd to send metrics to same port.

Now Start collectd

On Centos6

On Centos7

Install and Configure InfluxDB

You can install InfluxDB using

On Ubuntu

Start InfluxDB using

On Centos6

On Centos7

Now verify its accepting connections on UDP port 25836

By default Collectd data is stored in the database “collectd” . Let us connect to influxdb server and see if it has data from collectd

You can see mysql metrics data sent by collectd in the “collectd” database.

Now let us see how to visualize this data using Grafana.

Install Grafana

On Centos , You can install Grafana using Yum directly.

Find detailed installation details here

Start Grafana Server

On centos7

On Centos6

Now you should be able to login to Grafana using default login details

I have created a video on How to add “Influxdb” datasource in Grafana and create Graphs .

 

SUMMARY

In this article we have explained how to setup mysql monitoring using Influxdb , collectd and Grafana.

As always, feel free to drop us a note if you have any questions or feedback using our comment form below. Always happy to help ????

 

Leave a Reply

Your email address will not be published. Required fields are marked *