Skip to content

Latest commit

 

History

History

prometheus

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

prometheus

官网 管理页面

安装

解压即可

启动

nohup ./prometheus > /dev/null 2>&1 &

node_exporter

系统状态监控

安装

解压即可

启动

nohup ./node_exporter > /dev/null 2>&1 &

配置

  1. prometheus根目录
  2. 编辑配置文件vim prometheus.yml
    scrape_configs:
     # (省略其他配置)
     - job_name: "node"
       static_configs:
         - targets: ["192.168.31.201:9100","192.168.31.202:9100","192.168.31.203:9100"]
    
  3. 重启prometheus

mysqld_exporter

MySQL监控

安装

  1. 解压
  2. 配置账号 vim .my.cnf
    [client]
    user = root
    password = 123456
    

启动

nohup ./mysqld_exporter > /dev/null 2>&1 &

配置

  1. prometheus根目录
  2. 编辑配置文件vim prometheus.yml
    scrape_configs:
     # (省略其他配置)
     - job_name: "mysql"
       static_configs:
         - targets: ["192.168.31.201:9104"]
    
  3. 重启prometheus

Spring

配置

  • spring
    management:
     endpoints:
       web:
         exposure:
           include: 'prometheus, health, info'
     metrics:
       export:
         prometheus:
           enabled: true
  • Prometheus
    scrape_configs:
     # (省略其他配置)
     - job_name: "mysql"
       metrics_path: "/actuator/prometheus"
       static_configs:
         - targets: ["192.168.31.218:8080"]
    

Grafana

官网 管理页面

安装

解压即可

启动

nohup bin/grafana server > /dev/null 2>&1 &

其他说明

  • 第一次登录账号admin密码admin
  • 个人资料可改语言
  • 链接->数据源添加prometheusHTTP method选择GET