refactor: 边缘节点与配置精简

- 边缘: Prometheus 改为 vmagent,统一 docker-compose.yml,内存+磁盘缓存
- 边缘脚本: 合并为 deploy.sh [--local],删除 run-edge-local、quick-setup、run-edge-with-cache
- 配置: 合并为 update-configs.sh,统一 targets.csv,生成 target-onvif/target-ping/target-topology
- 删除 topology-editor、旧格式 devices.csv/ping-targets.csv、setup-remote-write、test-connection
- 文档: 更新 EDGE_CACHE、TIANDITU(瓦片改 4090 直连 tile-cache)

Made-with: Cursor
This commit is contained in:
User
2026-02-28 19:44:46 -05:00
parent 72a5bf30b4
commit 650e5145f1
35 changed files with 319 additions and 2774 deletions

34
doc/EDGE_CACHE.md Normal file
View File

@@ -0,0 +1,34 @@
# 边缘节点缓存
## 架构
`docker-compose.yaml` 使用 **vmagent** 统一实现:
| 层级 | 机制 | 说明 |
|------|------|------|
| **短时内存缓存** | 内存队列 | 中心短暂不可达时在内存中缓冲(~30 分钟量级) |
| **长时磁盘缓存** | 持久化队列 | 长时间离线时写入磁盘(默认 512MB恢复后自动补传 |
| **冗余重试** | 失败重试 | 自动重试,边缘重启后从磁盘恢复未上传数据 |
## 部署
```bash
cd edge-agent
bash deploy.sh
# 本机同机: bash deploy.sh --local
```
## 配置
| 参数 | 默认值 | 说明 |
|------|--------|------|
| `-remoteWrite.maxDiskUsagePerURL` | 512MB | 每 URL 最大磁盘缓存 |
| `-remoteWrite.tmpDataPath` | /cache/remotewrite | 磁盘队列路径 |
| `-memory.allowedPercent` | 80 | 内存队列可用比例 |
修改 `docker-compose.yaml``prometheus-edge``command` 可调整上述参数。
## 监控
- `vmagent_remotewrite_pending_bytes`:待发送字节数
- `vmagent_remotewrite_packets_dropped_total`:丢包数