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

基于openEuler22.03SP4部署Prometheus+Grafana

测试环境

Virtual Box,openEuler-22.03-LTS-SP4-x86_64-dvd.iso,4 vCPU, 8G RAM, 60 vDisk。最小化安装。需联网。

系统环境

关闭防火墙

systemctl stop firewalld

systemctl disable firewalld

systemctl status firewalld

selinux关闭

sed -ri ‘s/SELINUX=enforcing/SELINUX=disabled/’ /etc/selinux/config

安装Prometheus

Prometheus官网

下载prometheus的LTS版本

https://prometheus.io/download/

tar -zxvf prometheus-2.53.3.linux-amd64.tar.gz -C /usr/local/

mv /usr/local/prometheus-2.53.3.linux-amd64/ /usr/local/prometheus

cd /usr/local/prometheus

/usr/local/prometheus/prometheus --config.file=“/usr/local/prometheus/prometheus.yml” &

查看9090端口是否开启

ss -anlt | grep 9090

通过浏览器进入页面

http://192.168.31.244:9090/

数据展示

http://192.168.31.244:9090/metrics

安装Grafana

https://dl.grafana.com/enterprise/release/grafana-enterprise-11.4.0-1.x86_64.rpm

dnf install -y grafana-enterprise-11.4.0-1.x86_64.rpm

systemctl enable grafana-server

systemctl start grafana-server

浏览器输入http://192.168.31.244:3000

账号密码默认admin/admin

添加数据源,添加你的Prometheus服务地址和端口。

添加grafana监控模板,如果可以连接到外网, 那么直接输入id自动下载,如果不能连接外网,则需要访问
https://grafana.com/grafana/dashboards/网站寻找。比如12633, 8919模板,下载json文件导入即可。

安装node_exporter

tar -zxvf node_exporter-1.8.2.linux-amd64.tar.gz

cp node_exporter-1.8.2.linux-amd64/node_exporter /usr/local/bin/

为node_erporter创建service,使用systemctl管理

vi /usr/lib/systemd/system/node_exporter.service

[Unit]
Description=node_exporter
Documentation=https://prometheus.io/
After=network.target
[Service]
Type=simple
User=root
Group=root
ExecStart=/usr/local/bin/node_exporter
Restart=on-fallure
[Install]
WantedBy=multi-user.target

systemctl start node_exporter.service

systemctl enable node_exporter.service

修改监控主机Prometheus服务的配置文件,添加job

vi /usr/local/prometheus/prometheus.yml

scrape_configs:- job_name: 'Kingstar_ARM_prometheus'static_configs:- targets: ['192.168.31.244:9100']

用promtool检测配置文件是否正确

/usr/local/prometheus/promtool check config /usr/local/prometheus/prometheus.yml

重启prometheus

查看http://192.168.31.244:9090/targets地址,job和被监控节点正确显示。

刷新Grafana,仪表盘已显示主机。

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

相关文章:

  • 泛目录和泛站有什么差别
  • css 布局及动画应用(flex+transform+transition+animation)
  • springboot vue uniapp 仿小红书 1:1 还原 (含源码演示)
  • lombok在高版本idea中注解不生效的解决
  • 跨境电商领域云手机之选:亚矩阵云手机的卓越优势
  • Linux第二课:LinuxC高级 学习记录day02
  • 6. NLP自然语言处理(Natural Language Processing)
  • win10电脑 定时关机
  • linux删除用户
  • FPGA的 基本结构(Xilinx 公司Virtex-II 系列FPGA )
  • Springboot项目如何消费Kafka数据
  • LeetCode 热题 100 | 子串
  • 深度学习笔记11-优化器对比实验(Tensorflow)
  • 【掌握 JavaScript 数组迭代:map 和 includes 的使用技巧】
  • 深入浅出 Android AES 加密解密:从理论到实战
  • Clickhouse基础(一)
  • 深度学习|表示学习|一个神经元可以干什么|02
  • ubuntu22.04降级安装CUDA11.3
  • 为AI聊天工具添加一个知识系统 之32 三“中”全“会”:推理式的ISA(父类)和IOS(母本)以及生成式CMN (双亲委派)之1
  • Python----Python高级(函数基础,形参和实参,参数传递,全局变量和局部变量,匿名函数,递归函数,eval()函数,LEGB规则)
  • spring解决循环依赖的通俗理解
  • 用 Python 从零开始创建神经网络(十九):真实数据集
  • 介绍PyTorch张量
  • Vision Transformer (ViT)原理
  • 移动云自研云原生数据库入围国采!
  • Unity中对象池的使用(用一个简单粗暴的例子)
  • linux命令行连接Postgresql常用命令
  • 每日一题-单链表排序
  • webpack04服务器配置
  • JDK下载安装配置