Prometheus MySQL_exporter
MySQL Exporter mysqld_exporter 是用来搜集mysql的性能指标的,适用于mysql5.5及其以上版本 程序安装 下载地址: https://prometheus.io/download/#mysqld_exporter 安装mysqld_exporter tar -zxvf mysqld_exporter-0.11.0.linux- amd64.tar.gz mv mysqld_exporter -0.11.0.linux-amd64 /usr/local/mysqld_exporter 赋权 mysqld_exporter需要连接到Mysql,所以需要Mysql的权限,我们先为它创建用户并赋予所需的权限: CREATE USER ' exporter ' @ ' localhost ' IDENTIFIED BY ' abc123 ' WITH MAX_USER_CONNECTIONS 3 ; GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO ' exporter ' @ ' localhost ' ; 创建.my.cnf文件 cd /usr/local/ mysqld_exporter cat << EOF > .my.cnf [client] user = exporter password