美文网首页性能测试
mysql promethues 监控

mysql promethues 监控

作者: 杰罗米诺大背头 | 来源:发表于2020-03-16 19:12 被阅读0次

原文:https://www.cnblogs.com/xiangsikai/p/11289675.html

安装mysql_exporter

1、下载到被监控端解压压缩包

tar zxvf mysqld_exporter-0.11.0.linux-amd64.tar.gz

2、改名并移动到指定目录

mv mysqld_exporter-0.11.0.linux-amd64 /usr/local/mysql_exporter

cd /usr/local/mysql_exporter

3、登录root账户

4、创建mysql配置文件、运行时可免密码连接数据库:vim /usr/local/mysql_exporter/.my.cnf

[client]

user=root

password=123456

5、启动exporter客户端

./mysqld_exporter --config.my-cnf=.my.cnf

6、添加系统服务:vi /usr/lib/systemd/system/mysql_exporter.service

原文这里要修改下,不然系统服务器起不来

'''

[Unit]

Description=mysqld_exporter

After=network.target

[Service]

Type=simple

User=root

ExecStart=/packages/mysqld_exporter-0.11.0.linux-amd64/mysqld_exporter --config.my-cnf=/packages/mysqld_exporter-0.11.0.linux-amd64/.my.cnf

Restart=on-failure

[Install]

WantedBy=multi-user.target

'''

systemctl enable mysql_exporter.

systemctl daemon-reload

systemctl restart mysql_exporter.service

systemctl status mysql_exporter.service

添加promethues监控任务


访问该任务target:


grafana添加mysql监控面板:

面板Id:7362

相关文章

网友评论

    本文标题:mysql promethues 监控

    本文链接:https://www.haomeiwen.com/subject/hhwaehtx.html