I need to monitor Mysql using Prometheus and Grafana;
Added mysqld exporter in the client server
while starting the mysqld in the client server it reports as :
time="2017-09-05T11:42:53Z" level=info msg="Error scraping slave state: dial tcp [::1]:3306: getsockopt: connection refused" file="mysqld_exporter.go" line=824
time="2017-09-05T11:42:53Z" level=info msg="Error scraping table schema: dial tcp [::1]:3306: getsockopt: connection refused" file="mysqld_exporter.go" line=836
In client server :
- I have downloaded the mysqld exporter
- Extracted it
Created .my.cnf file
[client]
user=prompassword=abc123
Given permission to that user by using this command
mysql> GRANT REPLICATION CLIENT, PROCESS ON . TO 'prom'@'localhost' identified by 'abc123';
mysql> GRANT SELECT ON performance_schema.* TO 'prom'@'localhost';
Executed this command
./mysqld_exporter -config.my-cnf=".my.cnf"
Prometheus status page shows as UP condition for this. In Grafana no data is loaded for MySQL