Prometheus监控实战篇
一、Prometheus安装
1.下载Prometheus,我用的是2.32.1版本,需要其他版本可以去官方下载
wget https://github.com/prometheus/prometheus/releases/download/v2.32.1/prometheus-2.32.1.linux-amd64.tar.gz
2.解压
tar xf prometheus-2.32.1.linux-amd64.tar.gz
3. 启动
./prometheus --help # 命令帮助,可以根据自己的实际情况操作
nohup ./prometheus --web.listen-address=:9191 &>/opt/prometheus_servicer/log/prometheus_server.log &
二、Prometheus监控mysql
mysql_exporter下载地址
1.解压,并进入解压目录
tar xf mysqld_exporter-0.13.0.linux-amd64.tar.gz
2.数据库创建用户并授权
# 创建用户
CREATE USER 'exporter'@'localhost' IDENTIFIED BY '111111';