zoukankan      html  css  js  c++  java
  • promethus粘贴复制式部署文档

    Prometheus安装

     cd /usr/src/
     wget https://github.com/prometheus/prometheus/releases/download/v2.12.0/prometheus-2.12.0.linux-amd64.tar.gz
    tar xf prometheus-2.12.0.linux-amd64.tar.gz  -C /usr/local/
    cd /usr/local/
    ln -s prometheus-2.12.0.linux-amd64  prometheus
    

    设置systemctl prometheus 启动

    cat > /usr/lib/systemd/system/prometheus.service     << EOF
    [Unit]
    Description=Prometheus: the monitoring system
    Documentation=http://prometheus.io/docs/
    
    [Service]
    ExecStart=/usr/local/prometheus/prometheus  --config.file=/usr/local/prometheus/prometheus.yml
    Restart=always
    StartLimitInterval=0
    RestartSec=10
    
    [Install]
    WantedBy=multi-user.target
    EOF
    
    systemctl enable prometheus       ##制作开机启动prometheus  
    systemctl start prometheus            ##启动prometheus 
    systemctl status prometheus         ##查看promethus状态
    

    node_exporter安装部署 -> promethus依赖node_exporter来采集信息

    cd /usr/src/
    wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz
    tar xf node_exporter-0.18.1.linux-amd64.tar.gz  -C /usr/local/
    cd  /usr/local/
    ln -s node_exporter-0.18.1.linux-amd64  node_exporter
    

    制作systemctl方式启动node_exporter

    cat >  /usr/lib/systemd/system/node_exporter.service  <<  EOF
    [Unit]
    Description=Prometheus node exporter
    After=local-fs.target network-online.target network.target
    Wants=local-fs.target network-online.target network.target
    
    [Service]
    Restart=on-failure
    ExecStart="/usr/local/node_exporter/node_exporter"
    
    [Install]
    WantedBy=multi-user.target
    EOF
    

    制作node_exporter服务启动

    systemctl enable node_exporter.service     ##制作开机启动node_exporter
    systemctl start node_exporter.service          ##启动node_exporter
    systemctl status node_exporter.service       ##查看node_exporter状态
    

    访问方式

    http://localhost:9090
    

    获取主机信息

    curl http://localhost:9090/metrics
    

    如需要设置报警面板显示和监控多台机器可参考142机器的promethus.yml

  • 相关阅读:
    VS工具箱不显示DEV控件解决方法
    Win服务程序编写以及安装一般步骤
    cmd命令行带参启动程序
    C#递归拷贝文件夹下文件以及文件夹
    WPF中ComboBox控件绑定键值对操作
    MySQL学习(二)
    Mysql学习(一)
    XML学习(二)
    XML学习(一)
    关于Oracle本地连接出现与监听有关的问题的解决方法探讨
  • 原文地址:https://www.cnblogs.com/sxgaofeng/p/12408601.html
Copyright © 2011-2022 走看看