环境
CentOS 7.9
安装
1、命令下载
wget https://github.com/prometheus/mysqld_exporter/releases/download/v0.15.0/mysqld_exporter-0.15.0.linux-amd64.tar.gz tar -zxf mysqld_exporter-0.15.0.linux-amd64.tar.gz mv mysqld_exporter-0.15.0.linux-amd64.tar.gz /home/mysqld_exporter
2、配置系统服务
cat > /usr/lib/systemd/system/mysqld_exporter.service << EOF [Unit] Description=mysqld_exporter Service After=network.target [Service] Type=simple ExecStart=/home/mysqld_exporter/mysqld_exporter --config.my-cnf=/home/mysqld_exporter/.my.cnf ExecReload=/bin/kill -HUP \$MAINPID Restart=on-failure RestartSec=30s [Install] WantedBy=multi-user.target EOF
3、配置数据库监听用户
此处配置数据库对应的用户名密码
cd /usr/local/mysqld_exporter cat > .my.cnf <<EOF [client] user=*** password=*** EOF
4、启动、查看状态(默认端口9104)
systemctl start mysqld_exporter
systemctl status mysqld_exporter -l
标签:exporter,amd64,tar,接入,Linux,gz,mysqld,linux From: https://www.cnblogs.com/sefuture/p/17807871.html