CentOS7 prometheus +node_exporter+Grafana 安装篇
Posted xibuhaohao
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS7 prometheus +node_exporter+Grafana 安装篇相关的知识,希望对你有一定的参考价值。
一、下载与安装
1、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/
mv * /u01/soft/prometheus/
mkdir {data,cfg,logs,bin} -p
mv prometheus promtool bin/
mv prometheus.yml cfg/
vim /etc/profile
PATH= /u01/soft/prometheus/bin:$PATH:$HOME/bin
source /etc/profile
Description=Prometheus
Documentation=https://prometheus.io/
After=network.target
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
WantedBy=multi-user.target
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
[Unit]
Description=node_exporter
Documentation=https://prometheus.io/
After=network.target
Type=simple
User=prometheus
ExecStart=/u01/soft/prometheus/node_exporter/node_exporter
Restart=on-failure
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable node_exporter.service
systemctl start node_exporter.service
5)客户监控端数据汇报
http://172.16.102.15:9100/metrics
3、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界面
默认账号/密码:admin/admin
以上是关于CentOS7 prometheus +node_exporter+Grafana 安装篇的主要内容,如果未能解决你的问题,请参考以下文章
cAdvisor Prometheus container_cpu_load_average_10s具有两个值