普罗米修斯安装node_exporter组件

发布时间 2023-04-20 10:53:37作者: 创客未来

1.下载安装

下载地址:https://prometheus.io/download/

 上传服务器local下

 解压

 为了后续使用方便更名为:node_exporter

启动服务:

nohup /usr/local/node_exporter/node_exporter &

 查看端口9100占用情况

 浏览器查看页面

 修改普罗米修斯监控收集node节点信息

  • 在prometheus服务器的配置文件里添加被监控机器的配置段/usr/local/prometheus/prometheus.yml
  • 修改prometheus.yml配置文件
# my global config
global:
  scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).

# Alertmanager configuration
alerting:
  alertmanagers:
    - static_configs:
        - targets:
          # - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: "prometheus"

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
      - targets: ["localhost:9090"]
  - job_name: "mysql114"
    static_configs:
      - targets: ["10.0.0.13:9104"]
  - job_name: "node13"
    static_configs:
      - targets: ["10.0.0.13:9100"]

重启Prometheus服务

 

 

在grafana可视化可以看到