zoukankan      html  css  js  c++  java
  • 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 

  • 相关阅读:
    Python第二弹--------类和对象
    Python第一弹--------初步了解Python
    Java标记接口
    CentOS7下的YUM源服务器搭建详解,过程写的很详细(转)
    CentOS7.0安装Nginx 1.10.0
    QT中C++与Html端通信例子
    QT基础:QMainWindow学习小结
    QT基础:QT 定时器学习
    QT3D场景快速绘制入门学习
    QT编译错误:cannot find file: *.pro
  • 原文地址:https://www.cnblogs.com/lulin9501/p/15342192.html
Copyright © 2011-2022 走看看