二进制方式安装Prometheus与常用exporter安装

下载Prometheus二进制文件

sh 复制代码
wget https://github.com/prometheus/prometheus/releases/download/v2.47.2/prometheus-2.47.2.linux-amd64.tar.gz

解压缩,查看文件内容

sh 复制代码
tar -xf prometheus-2.47.2.linux-amd64.tar.gz -C /usr/local/
sh 复制代码
root@node1:~/prometheus-2.47.2.linux-amd64# tree
.
├── console_libraries
│   ├── menu.lib
│   └── prom.lib
├── consoles
│   ├── index.html.example
│   ├── node-cpu.html
│   ├── node-disk.html
│   ├── node.html
│   ├── node-overview.html
│   ├── prometheus.html
│   └── prometheus-overview.html
├── LICENSE
├── NOTICE
├── prometheus # prometheus二进制程序文件
├── prometheus.yml
└── promtool  # prometheus配置文件检查工具

创建软链接

sh 复制代码
root@node1:~# ln -s /usr/local/prometheus-2.47.2.linux-amd64/ /usr/local/prometheus

创建Service文件

sh 复制代码
root@node1:/usr/local/prometheus# cat /etc/systemd/system/prometheus.service 
[Unit]
Description=Prometheus
After=network.target

[Service]
WorkingDirectory=/usr/local/prometheus
ExecStart=/usr/local/prometheus/prometheus --config.file="/usr/local/prometheus/prometheus.yml"

[install]
WantedBy=multi-user.target

启动服务

sh 复制代码
systemctl daemon-reload 
systemctl start prometheus.service 

访问服务

默认端口9090

相关推荐
SomeB1oody1 天前
【RustyML入门】3.7. 循环层
开发语言·后端·机器学习·rust·教程
jerryinwuhan1 天前
《系统部署与运维》开篇 课程介绍
运维
东风破_1 天前
ESLint 是什么?为什么你的项目需要它?
前端·后端·代码规范
嘻哈∠※1 天前
0061基于 SpringBoot 的投稿与稿件处理系统设计与实现
java·spring boot·后端
卷无止境1 天前
在 awesome-fastapi 里,哪些库值得一看?
后端·python
我是谁??1 天前
Ubuntu22.04更换清华源
linux·运维·服务器
卷无止境1 天前
FastAPI 的Admin面板生态
后端·python
Shell运维手记1 天前
Linux 常用基础命令学习笔记
linux·运维·笔记·学习·算法·github
朴马丁1 天前
国际与国产PLM在精细化工赛道的布局:2026年主要厂商技术特色
大数据·运维·人工智能·流程行业plm·化工新材料
捡田螺的小男孩1 天前
什么是 Skill?手把手带你写一个简单有用的 Skill!
前端·后端·程序员