zoukankan      html  css  js  c++  java
  • Prometheus 和 Grafana的简单学习

    1. 下载

    暂时不采用 docker化部署

    prometheus下载地址

    https://github.com/prometheus/prometheus/releases/

    prometheus的explorter的下载

    https://github.com/prometheus/node_exporter/releases

    下载一个合适的版本

    5.03 MB node_exporter-0.16.0.linux-amd64.tar.gz

    grafana的下载

    2. 安装

    安装前置需要的包

    yum install -y git
    yum install -y go

    3. 安装prometheus

    解压缩

    然后添加环境变量

    cd /prometheus
    tar -zxvf prometheus-2.3.2.linux-amd64.tar.gz
    cd prometheus-2.3.2.linux-amd64
    cp * /usr/local/prometheus #没有的话创建目录

    #添加环境变量
    vi /etc/profile.d/prometheus.sh

    添加内容
    PATH=/usr/local/prometheus:$PATH export PATH

    返回原来的目录
    cd /prometheus
    创建一个yml文件
    vim prometheus.yml

    增加内容为:

    global:
        scrape_interval: 60s
        evaluation_interval: 60s

    scrape_configs:
        - job_name: prometheus
    static_configs:
        - targets: ['localhost:9090']
            labels:
                instance: prometheus

        - job_name: linux01
            static_configs:
                - targets: ['10.24.103.1:9100']
                    labels:
                        instance: linux01
        - job_name: linux02
            static_configs:
                - targets: ['10.24.103.2:9100']
                    labels:
                        instance: linux02

    启动

    nohup prometheus --config.file=prometheus.yml &

    打开浏览器进行验证  

    然后可以 status-> targets

    查看设备

    没有安装 node-exporter时 时 down的 需要安装下

     

    node-exporter的安装。

    方法:

     tar -zxvf node_exporter-0.16.0.linux-amd64.tar.gz 
     cd node_exporter-0.16.0.linux-amd64/
     nohup ./node_exporter &

    等一分钟 然后查看就是可用状态了。

     能监控很多很多项目

    当然了 我还没看懂。。。

    安装grafana

    将下载好的rpm包放到当前目录然后

    yum localinstall -y grafana-5.2.2-1.x86_64.rpm
    启动
    systemctl enable grafana-server
    systemctl start grafana-server
    登陆的话 默认端口 3000
    默认用户名 密码 admin admin

    修改 grafana的配置文件

    vi /etc/grafana/grafana.ini
  • 相关阅读:
    关于modelsim的波形文件(vsim.wlf)(转自http://www.eefocus.com/ican/blog/1010/196941_ebbde.html)
    c++ 头文件 再学习
    c++头文件和#include 学习笔记
    C++中嵌入汇编(vs)
    cocos2dx plist使用
    OpenGL 前凑
    别人的经验和自己现在的疑惑
    C++ 枚举类型
    cocos2dx draw & update
    const对象分析
  • 原文地址:https://www.cnblogs.com/jinanxiaolaohu/p/9413720.html
Copyright © 2011-2022 走看看