• CentOS7 prometheus +node_exporter+Grafana 安装篇


    一、prometheus下载与安装

    1、下载

    https://prometheus.io/download/ 

    2、安装

    上传prometheus-2.15.2.linux-amd64.tar.gz

    tar -xvf prometheus-2.15.2.linux-amd64.tar.gz

    mkdir /u01/soft/prometheus/

    groupadd prometheus
    useradd -g prometheus prometheus -d /u01/soft/prometheus/

    cd prometheus-2.5.0.linux-amd64/
    mv * /u01/soft/prometheus/
    cd /u01/soft/prometheus/
    mkdir {data,cfg,logs,bin} -p
    mv prometheus promtool bin/
    mv prometheus.yml cfg/
    chown -R prometheus.prometheus /u01/soft/prometheus/*

    3、设置环境变量

    vim /etc/profile
    PATH= /u01/soft/prometheus/bin:$PATH:$HOME/bin
    source /etc/profile

    4、创建prometheus.service 的 systemd unit 文件

    vim /etc/systemd/system/prometheus.service
    [Unit]
    Description=Prometheus
    Documentation=https://prometheus.io/
    After=network.target
    [Service]
    Type=simple
    User=prometheus
    ExecStart=/u01/soft/prometheus/bin/prometheus --config.file=/u01/soft/prometheus/cfg/prometheus.yml --storage.tsdb.path=/u01/soft/prometheus/data
    Restart=on-failure
    [Install]
    WantedBy=multi-user.target

    5、prometheus.yml配置文件

    先使用默认设置

    6、启动服务

    systemctl daemon-reload

    systemctl enable prometheus.service

    systemctl start prometheus.service

    systemctl status prometheus.service

    7、登录Prometheus自带有简单的UI

    http://172.16.102.15:9090/targets

    二、node_exporter下载与安装

    1、下载node_exporter

    在prometheus官网

    2、安装node_exporter

    (如果node_exporter与Prometheus不在同一台机器,请创建Prometheus用户,否则无法启动)

    groupadd prometheus
    useradd -g prometheus prometheus -d /u01/soft/prometheus/

    tar -vzxf node_exporter-0.18.1.linux-amd64
    mv node_exporter-0.18.1.linux-amd64 node_exporter

    3、创建node_exporter.service的 systemd unit 文件

    vim /usr/lib/systemd/system/node_exporter.service
    [Unit]
    Description=node_exporter
    Documentation=https://prometheus.io/
    After=network.target
    [Service]
    Type=simple
    User=prometheus
    ExecStart=/u01/soft/prometheus/node_exporter/node_exporter
    Restart=on-failure
    [Install]
    WantedBy=multi-user.target

    4、启动服务

    systemctl daemon-reload
    systemctl enable node_exporter.service
    systemctl start node_exporter.service


     5、客户监控端数据汇报

    http://172.16.102.15:9100/metrics

    三、grafana下载与安装

    1、下载grafana

    下载需要登陆

    user:xibuhaohao

    pass:

    https://grafana.com/grafana/download

    2、安装grafana

    mkdir /u01/soft/grafana/

    rpm -ivh grafana-6.5.3-1.x86_64.rpm


     3、启动服务

    systemctl daemon-reload
    systemctl enable grafana-server.service
    systemctl start grafana-server.service

    systemctl status grafana-server.service

    4、访问grafana WEB界面

    172.16.102.15:3000/

    默认账号/密码:admin/admin

  • 相关阅读:
    .NET中如何有效的使用Cache
    Page_Load与Page_PreRender的执行顺序
    TextBox取不到值及其TextBox取不到js赋的值
    Repeater用ul li,一行显示多条数据
    [转].net创建XML文件的两种方法
    【ABAP系列】SAP Web Dynpro 技术简介
    【SD系列】SAP SD模块-送达方和售达方的区别和联系
    【FICO系列】SAP FI模块-记账凭证FB01的BAPI
    【公众号系列】SAP 主要模块及简介
    【ABAP系列】SAP ABAP同时显示多个ALV的方法
  • 原文地址:https://www.cnblogs.com/xibuhaohao/p/12218356.html
Copyright © 2020-2023  润新知