zoukankan      html  css  js  c++  java
  • prometheus node_exporter部署

    curl url | sh 方式:

    install.sh

    #!/bin/bash
    
    #-------------------VAR------------------------------------------------
    ABS_INSTALL_PATH=/usr/local/bin/
    ABS_INSTALL_PREFIX=/usr/local/bin/node_exporter
    
    #-------------------FUN------------------------------------------------
    install_package(){
            if [ -e ${ABS_INSTALL_PREFIX} ];then
                    echo "====================WARNING====================="
                    echo "you may have installed node_exporter "
    
            else
                    yum install wget -y
                    cd ${ABS_INSTALL_PATH}
                    wget http://10.0.0.80/envs/yum/prometheus_node_exporter/node_exporter
    
    
                    if [ -e node_exporter ];then
                      chmod +x node_exporter
                      groupadd -r prometheus
                      useradd -r -g prometheus -s /sbin/nologin -M -c "prometheus Daemons" prometheus
    
                      cd /usr/lib/systemd/system
                      wget http://10.0.0.80/envs/yum/prometheus_node_exporter/node_exporter.service
                      systemctl start node_exporter
                      systemctl enable node_exporter
    
                    else
                      echo "=node_exporter file not exist"
                    fi
            fi
    }
    main(){
            install_package
    }
    #-------------------PROGRAM--------------------------------------------
    main
    

      

    node_exporter.service

    [Service]
    User=prometheus
    Group=prometheus
    ExecStart=/usr/local/bin/node_exporter
    
    [Install]
    WantedBy=multi-user.target
    
    [Unit]
    Description=node_exporter
    After=network.target
    

      

    手动起:

    nohup /usr/local/bin/node_exporter --web.listen-address=":9101" &

  • 相关阅读:
    Feature euerka Consul zookeeper etcd
    mysql配置参数
    镜像网站
    携程Apollo分布式配置中心部署以及使用
    linux 基础知识 之基础网络
    linux 基础知识 之基础系统管理
    linux安全
    java.多态
    java.抽象、接口
    使用Vscode
  • 原文地址:https://www.cnblogs.com/jabbok/p/12850115.html
Copyright © 2011-2022 走看看