二进制方式安装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

相关推荐
Justin3go3 小时前
HUNT0 上线了——尽早发布,尽早发现
前端·后端·程序员
Tony Bai4 小时前
高并发后端:坚守 Go,还是拥抱 Rust?
开发语言·后端·golang·rust
Elastic 中国社区官方博客4 小时前
使用 Elastic Cloud Serverless 扩展批量索引
大数据·运维·数据库·elasticsearch·搜索引擎·云原生·serverless
一线大码4 小时前
SpringBoot 3 和 4 的版本新特性和升级要点
java·spring boot·后端
超龄超能程序猿4 小时前
Docker GPU插件(NVIDIA Container Toolkit)安装
运维·docker·容器
weixin_425023005 小时前
Spring Boot 配置文件优先级详解
spring boot·后端·python
weixin_425023005 小时前
Spring Boot 实用核心技巧汇总:日期格式化、线程管控、MCP服务、AOP进阶等
java·spring boot·后端
一线大码5 小时前
Java 8-25 各个版本新特性总结
java·后端
2501_906150565 小时前
私有部署问卷系统操作实战记录-DWSurvey
java·运维·服务器·spring·开源
VX:Fegn08955 小时前
计算机毕业设计|基于springboot + vue校园社团管理系统(源码+数据库+文档)
前端·数据库·vue.js·spring boot·后端·课程设计