Files
PromdataPanel/README.md
2026-04-06 15:17:16 +08:00

71 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# PromdataPanel
多源 Prometheus 服务器监控展示大屏。支持对接多个 Prometheus 实例,实时聚合展示所有服务器的 CPU、内存、磁盘、带宽等关键指标并提供可视化节点分布图。
## 功能特性
- 🔌 **多数据源管理** - 支持对接多个 Prometheus 实例Node_Exporter / BlackboxExporter
- 📊 **指标自动聚合** - 自动汇总所有数据源的 NodeExporter 指标,实时计算全网负载
- 🌐 **网络流量统计** - 24 小时流量趋势图实时带宽Rx/Tx求和显示
- 🗺️ **节点分布可视化** - 自动识别服务器地理位置,并在全球地图上展示实时连接状态与延迟
-**毫秒级实时性** - 深度优化查询逻辑,支持 5s 采集频率的实时动态展示
- 📱 **响应式与美学设计** - 现代 UI/UX 体验,支持暗色模式,极致性能优化
## 快速安装
### 方式一:一键脚本安装 (推荐)
在 Linux 服务器上,您可以使用以下脚本一键完成下载、环境检测、依赖安装并将其注册为 Systemd 系统服务:
```bash
# 下载安装最新版本 (默认 v0.1.0)
VERSION=v0.1.0 curl -sSL https://git.littlediary.cn/CN-JS-HuiBai/PromdataPanel/raw/branch/main/install.sh | bash
```
### 方式二:手动安装
#### 1. 环境要求
- **Node.js** >= 18
- **MySQL** >= 8.0
- **Valkey** >= 7.0 (或 Redis >= 6.0)
#### 2. 配置与启动
1. 克隆代码库:`git clone https://git.littlediary.cn/CN-JS-HuiBai/PromdataPanel.git`
2. 复制配置文件:`cp .env.example .env`
3. 安装依赖:`npm install --production`
4. 启动服务:`npm start`
#### 3. 系统初始化
首次运行后,访问 `http://your-ip:3000/init.html`,按照引导完成 MySQL 数据库和 Valkey 缓存的连接。
## 使用指引
### 1. 添加 Prometheus 数据源
点击页面右上角的 ⚙️ 按钮进入设置,添加并测试您的 Prometheus HTTP 地址。
### 2. Prometheus 采集配置
建议在 `prometheus.yml` 中设置采集周期为 `5s` 以实现平滑的实时动态效果:
```yaml
global:
scrape_interval: 5s
scrape_configs:
- job_name: 'nodes'
static_configs:
- targets: ['your-server-ip:9100']
```
## 技术栈
- **Runtime**: Node.js
- **Framework**: Express.js
- **Database**: MySQL 8.0+
- **Caching**: Valkey / Redis
- **Visualization**: ECharts / Canvas
- **Frontend**: Vanilla JS / CSS3
## LICENSE
MIT License