安装mysqld_exporter
上传监控软件
[root@gtcq-gt-monitor-prometheus-01 opt]# scp root@62.234.150.127:/opt/mysqld_exporter-0.11.0.linux-amd64.tar.gz ./
解压操作
[root@gtcq-gt-monitor-prometheus-01 opt]# tar -zxvf mysqld_exporter-0.11.0.linux-amd64.tar.gz -C /usr/local/
mysqld_exporter-0.11.0.linux-amd64/
mysqld_exporter-0.11.0.linux-amd64/NOTICE
mysqld_exporter-0.11.0.linux-amd64/LICENSE
mysqld_exporter-0.11.0.linux-amd64/mysqld_exporter
[root@gtcq-gt-monitor-prometheus-01 opt]# cd /usr/local/
[root@gtcq-gt-monitor-prometheus-01 local]# ls
alertmanager elasticsearch_exporter include libexec node_exporter sbin
bin etc lib mysqld_exporter-0.11.0.linux-amd64 nohup.out share
blackbox_exporter games lib64 nginx prometheus src
[root@gtcq-gt-monitor-prometheus-01 local]# mv mysqld_exporter-0.11.0.linux-amd64 mysqld_exporter
[root@gtcq-gt-monitor-prometheus-01 local]#
修改配置文件
[root@gtcq-gt-monitor-prometheus-01 mysqld_exporter]# more .my.cnf
[client]
host=10.152.17.22
port=3306
user=monitor
password=tYx&bXXX
[root@gtcq-gt-monitor-prometheus-01 mysqld_exporter]#
启动服务
[root@gtcq-gt-monitor-prometheus-01 mysqld_exporter]# nohup ./mysqld_exporter --web.listen-address=":9104" --config.my-cnf=/usr/local/gmc_mysqld_exporter/.my.cnf &
绘图
推荐图标ID:https://grafana.com/dashboards/7362