当前位置: 首页 > news >正文

Prometheus的搭建与使用

一、安装Prometheus

官网下载地址:Download | Prometheus

解压:tar -zxvf prometheus-2.19.2.linux-amd64.tar.gz重命名: mv prometheus-2.19.2.linux-amd64 /home/prometheus进入对应目录: cd /home/prometheus查看配置文件:cat prometheus.yml# 前台启动
./prometheus --config.file=prometheus.yml# 后台启动
nohup ./prometheus --config.file=prometheus.yml > ./prometheus.log 2>&1 &

验证是否成功:http://***.***.***.***:9090/graph

如果查不到数据可以检查下我们的targets是否有报错

在这里插入图片描述

 

二、安装Grafana

官方下载地址:Download Grafana | Grafana Labs

下载:wget https://dl.grafana.com/oss/release/grafana-7.0.5-1.x86_64.rpm 安装:yum install grafana-7.0.5-1.x86_64.rpm启动:systemctl daemon-reload
systemctl enable grafana-server.service
systemctl start grafana-server.service

验证是否成功:http://***.***.***.***:3000

默认用户名密码都是admin,初次登录会要求修改默认的登录密码

添加数据源

1.点击DATA SOURCES

 2.选择Prometheus

3.Dashboards中import “Prometheus 2.0 Stats”

4.Settings界面填写服务器地址

 5.切换界面

五、添加监控项

1.linux

下载node_exporter:

wget https://github.com/prometheus/node_exporter/releases/download/v1.0.1/node_exporter-1.0.1.linux-amd64.tar.gz

解压:tar -zxvf node_exporter-1.0.1.linux-amd64.tar.gz

启动: ./node_exporter &

注释:记得查看防火墙9100端口是否开启

这时候会看到如下警告

level=info ts=2020-07-09T02:24:55.402Z caller=tls_config.go:170 msg="TLS is disabled and it cannot be enabled on the fly." http2=false

这是因为Node Exporter 自v1.0.0 版本加了TLS验证(这个在后序篇幅讲,此次跳过)

到官网选择一个喜欢的仪表盘:Dashboards | Grafana Labs

查看id

 导入仪表盘

在文本框里输入对应id即可导入

http://www.lryc.cn/news/130295.html

相关文章:

  • 实战指南,SpringBoot + Mybatis 如何对接多数据源
  • 论文阅读——Imperceptible Adversarial Attack via Invertible Neural Networks
  • List和ObservableCollection和ListBinding在MVVM模式下的对比
  • insightface安装过程中提示 Microsoft Visual C++ 14.0 or greater is required.
  • mongodb数据库
  • OpenCV-Python中的图像处理-图像特征
  • Ajax入门+aixos+HTTP协议
  • conda创建虚拟环境
  • Golang服务的请求调度
  • Jenkins的流水线启动jar后未执行问题处理
  • 智慧工地平台工地人员管理系统 可视化大数据智能云平台源码
  • 外包干了2个月测试,技术退步明显...
  • 神经网络基础-神经网络补充概念-19-向量化实现的解释
  • 四层和七层负载均衡的区别
  • Scala 如何调试隐式转换--隐式转换代码的显示展示
  • Rust交叉编译简述 —— Arm
  • 算法与数据结构(二十三)动态规划设计:最长递增子序列
  • 相机的位姿在地固坐标系ECEF和ENU坐标系的转换
  • RFID技术助力汽车零配件装配产线,提升效率与准确性
  • 应用高分辨率 GAN 对扰动文档图像去扭曲的深度Python实践
  • 【BASH】回顾与知识点梳理(二十六)
  • React下载文件的两种方式
  • python入门知识:分支结构
  • DNS协议及其工作原理
  • 调用被fishhook的原函数
  • java语言B/S架构云HIS医院信息系统源码【springboot】
  • go文件基本操作
  • 每日一学——应用层
  • blender的快捷键记录
  • 3D- vista:预训练的3D视觉和文本对齐Transformer