Grafana+Prometheus监控MySQL及服务器性能

Grafana+Prometheus监控服务器及数据库

需要安装相关组件

  1. prometheus 是一套开源的监控报警与时间序列数据库的组合
  2. grafana 是一个跨平台的开源度量分析和可视化工具,可以通过采集的数据查询然后可视化的展示,并及时通知
  3. node_exporter 采集器,负责将linux采集的数据存储到prometheus数据库,然后grafana去prometheus数据库的数据进行展示
  4. mysqld_exporter 采集器,负责将mysql采集的数据存储到prometheus数据库,然后grafana去prometheus数据库的数据进行展示

安装prometheus

安装grafana

安装node_exporter

安装mysqld_exporter

监控Mysql数据库

  1. 安装所有组件
  2. 修改prometheus配置文件,scrape_configs下面添加
# vim /usr/local/prometheus/prometheus.yml
scrape_configs:
  - job_name: 'mysql'
    static_configs:
      - targets: ['localhost:9104']
  1. 在界面搜索mysql能看到mysql相关信息

监控Linux系统

  1. 安装所有组件
  2. 修改prometheus配置文件,scrape_configs下面添加
scrape_configs:
  - job_name: "node info"
    static_configs:
    - targets: ['localhost:9100']
  1. 查看Targets是否是up状态
posted @ 2020-11-16 17:59  SunFree  阅读(232)  评论(0编辑  收藏  举报