匿名
未登录
登录
Linux78|wiki
搜索
查看“Prometheus Mysql监控及Grafana可视化”的源代码
来自Linux78|wiki
名字空间
页面
讨论
更多
更多
页面选项
查看
查看源代码
历史
←
Prometheus Mysql监控及Grafana可视化
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
wiki:用户|用户
您可以查看与复制此页面的源代码。
mysql_exporter:用于收集MySQL性能信息。 使用文档:https://github.com/prometheus/mysqld_exporter 图标模板:https://grafana.com/dashboards/7362 下载地址:https://github.com/prometheus/mysqld_exporter/releases/download/v0.12.1/mysqld_exporter-0.12.1.linux-amd64.tar.gz === 安装mysql_exporter === wget https://github.com/prometheus/mysqld_exporter/releases/download/v0.12.1/mysqld_exporter-0.12.1.linux-amd64.tar.gz tar zxvf mysqld_exporter-0.11.0.linux-amd64.tar.gz -C /usr/local ln -s /usr/localmysqld_exporter-0.11.0.linux-amd64 /usr/local/mysql_exporter cd /usr/local/mysql_exporter # 创建数据库用户。 mysql> CREATE USER 'exporter'@'localhost' IDENTIFIED BY '12345'; # 可查看主从运行情况查看线程,及所有数据库。 mysql> GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO 'exporter'@'localhost'; vim /usr/local/mysql_exporter/.my.cnf [client] user=exporter password=12345 === 启动exporter客户端 === ./mysqld_exporter --config.my-cnf=.my.cnf 启动常用参数 常用参数: # 选择采集innodb --collect.info_schema.innodb_cmp # innodb存储引擎状态 --collect.engine_innodb_status # 指定配置文件 --config.my-cnf=".my.cnf" === 添加系统服务 === vi /usr/lib/systemd/system/mysql_exporter.service [Unit] Description=https://prometheus.io [Service] Restart=on-failureExecStart=/usr/local/mysql_exporter/mysqld_exporter --config.my-cnf=.my.cnf [Install] WantedBy=multi-user.target systemctl daemon-reload systemctl restart mysql_exporter.service === 查看捕获mysql数据 === 访问:http://IP:9104/metrics === 使用prometheus监控修改监控端配置文件 === vim prometheus.yml scrape_configs: # 添加作业并命名 - job_name: 'mysql' # 静态添加node static_configs: # 指定监控端 - targets: ['47.98.138.176:9104'] === Granfana 导入Mysql 监控图表 === 推荐图标ID:https://grafana.com/dashboards/7362
返回至
Prometheus Mysql监控及Grafana可视化
。
导航
导航
首页
最近更改
随机页面
栏目
Nginx
Kubernetes
Spring Cloud
Wiki工具
Wiki工具
特殊页面
页面工具
页面工具
用户页面工具
更多
链入页面
相关更改
页面信息
页面日志