Files
Distributed-Prometheus/doc/CENTRAL_SERVER_CONFIG.md
jack ab1515dffb refactor: config/apps 目录重组、文档重构、架构图收窄
- 中央:config/(prometheus,alertmanager,grafana)、apps/(tile-cache,topology-editor)
- 边缘:config/(vmagent,blackbox,targets)、apps/(onvif-exporter)
- env: TRAEFIK_PROVIDER、prometheus/env.example 详细说明
- 文档:README/doc 重构,EDGE_CACHE 合并到 EDGE_AGENT_CONFIG
- targets.csv 更新流程说明,ARCHITECTURE 图收窄

Made-with: Cursor
2026-02-28 22:05:43 -05:00

45 lines
2.6 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.
# 中央服务器配置文件说明
## 目录结构
```
central-server/
├── docker-compose.yml # 服务编排
├── deploy.sh # 部署脚本
├── config/ # 配置目录
│ ├── prometheus/ # Prometheus 配置prometheus.yml、alert_rules.yml
│ ├── alertmanager/ # Alertmanager 配置
│ └── grafana/ # Grafana 配置provisioning、dashboards
├── apps/ # 自建应用源码
│ ├── tile-cache/ # 天地图瓦片缓存
│ └── topology-editor/ # GPS 标注助手
└── data/ # 运行时数据gitignore
```
## 主要服务与端口
| 服务 | 端口 | 说明 |
|------|------|------|
| prometheus-central | 9091 | 自抓 + 告警评估;边缘数据由 Grafana 从 VictoriaMetrics 查询 |
| grafana | 3000 | 数据源Prometheus中央自抓、VictoriaMetrics边缘数据 |
| victoria-metrics | 8428 | 接收边缘 remote_write |
| alertmanager | 9093 | 告警路由与通知 |
## 关键配置摘要
- **config/prometheus/prometheus.yml**`remote_write` 指向 VictoriaMetrics`rule_files: alert_rules.yml`抓取自身、VM、Alertmanager、Grafana。
- **告警规则与通知**:见 [ALERTING.md](ALERTING.md)。
- **Grafana 数据源**Provisioning 下配置 Prometheus、VictoriaMetrics查边缘指标请选 **VictoriaMetrics**
- **Grafana Geomap 使用天地图缓存**:在 Geomap 面板中将 Base layer 选为 **XYZ Tile layer**,底图 URL 填 `http://<central>:4090/tiles/vec/{z}/{x}/{y}`,再添加一层 XYZ 填 `http://<central>:4090/tiles/cva/{z}/{x}/{y}`中文注记。key 仅需在 central 配置 `TIANDITU_TK`,无需在 Grafana 中填写。详见 [TIANDITU_CONFIG.md](TIANDITU_CONFIG.md)。
- **多用户**`config/grafana/setup-users.sh`,见 [USER_MANAGEMENT.md](USER_MANAGEMENT.md)。
## 修改与重载
- Prometheus`config/prometheus/prometheus.yml``config/prometheus/alert_rules.yml``docker compose restart prometheus-central`,或 `curl -X POST http://localhost:9091/-/reload`(若启用 lifecycle
- Alertmanager`config/alertmanager/alertmanager.yml``docker compose restart alertmanager`
- Grafana改 provisioning 后重启;或通过 Web UI 修改(持久化到库)。
## 相关文档
- [ARCHITECTURE.md](ARCHITECTURE.md) | [ALERTING.md](ALERTING.md) | [USER_MANAGEMENT.md](USER_MANAGEMENT.md) | [central-server/CONFIGURATION.md](../central-server/CONFIGURATION.md)