• 3 安装node_exporter


    1 下载地址

    https://prometheus.io/download/

    安装服务器的ip地址是 172.17.209.53

    2 下载并安装

    [root@tech-ops-test tar]# mkdir /usr/local/tar
    [root@tech-ops-test tar]# cd  /usr/local/tar
    [root@tech-ops-test tar]# wget https://github.com/prometheus/node_exporter/releases/download/v1.2.2/node_exporter-1.2.2.linux-amd64.tar.gz
    [root@tech-ops-test tar]# tar -xvf node_exporter-1.2.2.linux-amd64.tar.gz -C /usr/local/
    [root@tech-ops-test tar]# cd /usr/local/
    [root@tech-ops-test local]# mv node_exporter-1.2.2.linux-amd64 node_exporter-1.2.2
    [root@tech-ops-test local]# cd node_exporter-1.2.2/

    3 启动

    [root@tech-ops-test node_exporter-1.2.2]# nohup ./node_exporter &

    [root@tech-ops-test node_exporter-1.2.2]# netstat -anlp | grep 9100
    tcp6 0 0 :::9100 :::* LISTEN 22759/./node_export

    4 修改promethues的配置文件

    在 scrape_configs 下添加 job_name

    scrape_configs:
      # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
    
      - job_name: "node_exporter"
        static_configs:
          - targets: ["172.17.209.53:9100"]
            labels:
              group: 'node_exporter'

    启动promethues的时候添加 --web.enable-lifecycle 参数可以通过http 请求加载配置文件

    如果不添加这个  --web.enable-lifecycle 参数,可以发送HUP 信号重新加载

    两种加载的配置文件

    # 第一种,向prometheus进行发信号
    kill -HUP  pid
    
    # 第二种,向prometheus发送HTTP请求
    # /-/reload只接收POST请求,并且需要在启动prometheus进程时,指定 --web.enable-lifecycle
    curl -XPOST http://prometheusip/-/reload

    5 查看promethus的界面

    可以看到 job_name 的node_exporter 下有一个刚才添加的 node_exporter 

  • 相关阅读:
    SQL之层次查询
    GROUP函数
    SQL之统计
    正则表达式
    聚合函数,分析函数
    oracle函数
    Vue3.0优化
    浅谈FC
    短链接生成原理
    Vue路由传参
  • 原文地址:https://www.cnblogs.com/lulin9501/p/15342192.html
Copyright © 2020-2023  润新知