feat: 引入 vmauth 鉴权与严格多租户

- 对外端口统一为 18428(vmauth 入口),VM 不再直接暴露宿主机端口
- 边缘 vmagent 与中央 Prometheus remote_write 增加 basic auth
- 支持 tenants.csv 驱动的 per-tenant 写入/查询隔离,并提供管理员跨租户只读查询
- 更新 Grafana provisioning 与部署/文档

Made-with: Cursor
This commit is contained in:
root
2026-04-22 11:41:13 +00:00
parent ab1515dffb
commit c4825c2d27
21 changed files with 278 additions and 37 deletions

View File

@@ -64,7 +64,7 @@ netstat -tulpn | grep <端口>
2. **在中央直接查 VictoriaMetrics**
在**中央服务器**上执行(或浏览器访问):
```bash
curl -sG 'http://localhost:8428/api/v1/series' --data-urlencode 'match[]=probe_success{job="network-ping"}'
curl -u 'vm_read:change-me-strong-read' -sG 'http://localhost:18428/api/v1/series' --data-urlencode 'match[]=probe_success{job="network-ping"}'
```
- 若返回 `"data":[]` 表示还没有收到边缘数据(可能是网络不通、刚启动未到抓取周期、或 remote_write 失败)。
- 若 `data` 里有元素(带 `__name__`、`job`、`region` 等),说明边缘数据已写入中央。
@@ -81,7 +81,7 @@ curl http://localhost:9092/api/v1/query?query=up
# 2. 检查网络连通性
ping <中央服务器IP>
telnet <中央服务器IP> 8428
telnet <中央服务器IP> 18428
# 3. 检查环境变量
cat edge-agent/.env