普罗米修斯Prometheus监控MySQL

普罗米修斯Prometheus监控MySQL

添加数据库用户

CREATE USER monitor_prometheus@'192.168.245.%' IDENTIFIED BY 'Abcde@123';
GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO monitor_prometheus@'192.168.245.%';

创建mysql配置文件

cat >.my.cnf <

安装并启动mysql采集客户端

wget -c https://github-production-release-asset-2e65be.s3.amazonaws.com/32075541/113de280-b210-11e9-8359-0f8a58a8c694?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200131%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200131T060047Z&X-Amz-Expires=300&X-Amz-Signature=05e5d6005958462b34a47be2ac470e09666e2502bc5ae4e2b789f2bbff2997e5&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dmysqld_exporter-0.12.1.linux-amd64.tar.gz&response-content-type=application%2Foctet-stream

tar -zxvf mysqld_exporter-0.12.1.linux-amd64 -C /usr/local

./mysqld_exporter --config.my-cnf=.my.cnf --collect.info_schema.innodb_cmp --collect.engine_innodb_status

服务端配置文件加入客户端节点

scrape_configs:
  	# 添加作业并命名
  	- job_name: 'mysql'
    # 静态添加node
    	static_configs:
    # 指定监控端
    	- targets: ['192.168.245.128:9104']

grafana加入dashborard 7362

你可能感兴趣的:(监控,MySQL,prometheus)