1. 程式人生 > >Prometheus+Grafana打造Mysql監控平臺

Prometheus+Grafana打造Mysql監控平臺

  • 下載Prometheus放到監控端(或被監控端)。
    • 配置檔案prometheus.yml ```yml scrape_configs:
      • job_name: prometheus static_configs: - targets: ['localhost:9090'] labels: instance: prometheus

      • job_name: linux static_configs: # 192.168.1.7為node_exporter所在伺服器的IP;9100為node_exporter暴露的埠 - targets: ['192.168.1.7:9100'] labels: #db1為例項名,以後在Grafana獲取prometheus時,要配置prometheus所有伺服器的host為db1 instance: db1

      • job_name: mysql static_configs: # 192.168.1.7為mysqld_exporter所在伺服器的IP;9100為mysqld_exporter暴露的埠 - targets: ['192.168.1.7:9104'] labels: instance: db1 ```