prometheus监控mysql指标_Prometheus监控MySQL服务(六)

一、监控使用mysqld_exporter插件

支持的MySQL和MariaDB版本:5.5及以上,需要注意的MySQL/MariaDB<5.6并不支持所有的收集方法

# wget https://github.com/prometheus/mysqld_exporter/releases/download/v0.12.1/mysqld_exporter-0.12.1.linux-amd64.tar.gz

# tar xf mysqld_exporter-0.12.1.linux-amd64.tar.gz -C /usr/local/#ln -s /usr/local/mysqld_exporter-0.12.1.linux-amd64/ /usr/local/mysqld_exporter

# cd/usr/local/mysqld_exporter

# 查看需要监控的指标

# ./mysqld_exporter --help

二、在MySQL中创建帐号

# mysql -uroot -p

mysql> CREATE USER 'exporter'@'192.168.5.237' IDENTIFIED BY 'exporter';

GRANT PROCESS, REPLICATION CLIENT, SELECT ON*.* TO 'exporter'@'192.168.5.237';Query OK, 0 rows affected (0.03sec)

mysql> GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO 'exporter'@'192.168.5.237';

Query OK,0 rows affected (0.00 sec)

你可能感兴趣的:(prometheus监控mysql指标_Prometheus监控MySQL服务(六))