Record verified production deployment and operational handoff

This commit is contained in:
qiubaishen
2026-10-15 18:45:18 +08:00
parent 6fe851108d
commit f04e023cd7
6 changed files with 59 additions and 1 deletions
+9 -1
View File
@@ -10,7 +10,7 @@ The user wants the work performed incrementally. On 2026-10-15 the user changed
- User explicitly authorized deploying the current monitoring project to SSH alias `server134-rot`, directory `/opt/observability/`, and committing/pushing this workspace to `https://git.weytoken.com/qiubs/observability.git`. - User explicitly authorized deploying the current monitoring project to SSH alias `server134-rot`, directory `/opt/observability/`, and committing/pushing this workspace to `https://git.weytoken.com/qiubs/observability.git`.
- This authorization supersedes the historical test-server-only scope for this target. It does not authorize unrelated application/DB/firewall/nginx changes or public exposure. - This authorization supersedes the historical test-server-only scope for this target. It does not authorize unrelated application/DB/firewall/nginx changes or public exposure.
- Remote Git had no refs when checked. Initialized local main using the existing identity from the adjacent monkey-ai checkout; initial import/push is in progress. - Remote Git had no refs when checked. Initialized local main using the existing identity from the adjacent monkey-ai checkout and pushed to origin/main. Initial import f657abe; offline-plugin support 6fe8511. Read /opt/observability/DEPLOYED_COMMIT for the final deployed revision including documentation.
- User corrected SSH configuration: `root@134.175.227.134:22`. Connection and read-only checks succeeded: Ubuntu 22.04.5, x86_64, 2 CPUs, 7.6 GiB RAM (5.7 GiB available), 49 GiB disk available, Docker 29.1.3, Compose 2.40.3, synchronized time. - User corrected SSH configuration: `root@134.175.227.134:22`. Connection and read-only checks succeeded: Ubuntu 22.04.5, x86_64, 2 CPUs, 7.6 GiB RAM (5.7 GiB available), 49 GiB disk available, Docker 29.1.3, Compose 2.40.3, synchronized time.
- `/opt/observability/` contains older project files, but no running monitoring containers or monitoring data/. Preserve these with a backup before upload. Existing application listeners use 3000 and 3001; do not restart them. - `/opt/observability/` contains older project files, but no running monitoring containers or monitoring data/. Preserve these with a backup before upload. Existing application listeners use 3000 and 3001; do not restart them.
- Keep all monitoring ports on loopback. Set GRAFANA_PORT=3002; suggested workstation tunnel ports: 13000 -> remote 3002, 19093 -> remote 9093. - Keep all monitoring ports on loopback. Set GRAFANA_PORT=3002; suggested workstation tunnel ports: 13000 -> remote 3002, 19093 -> remote 9093.
@@ -18,6 +18,14 @@ The user wants the work performed incrementally. On 2026-10-15 the user changed
- Server `prepare.sh` now restricts `.env` to mode 0600 and does not print the generated Grafana password. - Server `prepare.sh` now restricts `.env` to mode 0600 and does not print the generated Grafana password.
- Production app/MySQL targets have not been supplied; do not upload local credentials or use the Windows host.docker.internal target on Linux. - Production app/MySQL targets have not been supplied; do not upload local credentials or use the Windows host.docker.internal target on Linux.
- The user subsequently supplied a screenshot showing local mysql_up=1. This updates the older credentials-absent snapshot below, but is not a new independently executed full MySQL smoke check. - The user subsequently supplied a screenshot showing local mysql_up=1. This updates the older credentials-absent snapshot below, but is not a new independently executed full MySQL smoke check.
- Production deployment completed on 2026-10-15. Eight containers running, all ten published ports loopback; all eight scrape targets healthy with production labels; four vmalert rules evaluate without errors; Alertmanager has zero active alerts.
- Remote smoke exited 0: fresh Metrics, Logs and exact Trace readback, three authenticated Grafana datasource health checks, and monitor-host-overview dashboard all passed. Synthetic run=f2b2983492f83f83, trace=c4c50887907cda3c5721ead9ebd63f01.
- Existing monkey-ai processes on 3000/3001 retained their PIDs and both /api/status endpoints returned HTTP 200 with success=true. Production application monitoring has not yet been configured.
- Old directory backup: /opt/observability-backups/before-f657abe.tar.gz (verified archive, mode 0600). Deployment release archives are extracted under /opt/observability-releases/.
- Server registry mirrors failed image size validation. Imported exact pinned Linux amd64 images from workstation after SHA256 checks. Do not change/restart Docker daemon to work around this. Start cached images with port preflight then docker compose up -d --pull never.
- Log datasource plugin 0.32.0 was imported, signature verification retained, Linux backend executable mode restored to 0755 after Windows transfer. Server .env sets GRAFANA_PREINSTALL_PLUGINS= to avoid repeated downloads; do not set this on a clean host without preinstalling the plugin.
- Post-deployment snapshot: about 5.2 GiB RAM available and 45 GiB disk available; no OOM kills or restart loops. This is initial idle usage, not load-test capacity evidence.
- A fresh Windows local smoke during deployment passed synthetic Metrics/Logs/Traces but failed the new-api probe (probe_success=0). Local scrape up stayed 1, including local-mysql. Do not claim the current local full smoke or MySQL-specific checks passed; no local app was changed. This failure is separate from the successful remote smoke.
## Local Validation History (2026-10-15) ## Local Validation History (2026-10-15)
+2
View File
@@ -15,6 +15,8 @@
用户指定 SSH 别名 `server134-rot`(134.175.227.134),目录 `/opt/observability/`。部署目录对应本仓库 `deploy/monitoring/` 的内容。2026-10-15 已确认 Ubuntu 22.04、2 核、7.6 GiB 内存、磁盘剩余约 49 GiB。服务器已有应用占用 3000/3001,Grafana 使用回环 3002;具体部署参数见 [server134 运维说明](deploy/monitoring/README.server134.md)。 用户指定 SSH 别名 `server134-rot`(134.175.227.134),目录 `/opt/observability/`。部署目录对应本仓库 `deploy/monitoring/` 的内容。2026-10-15 已确认 Ubuntu 22.04、2 核、7.6 GiB 内存、磁盘剩余约 49 GiB。服务器已有应用占用 3000/3001,Grafana 使用回环 3002;具体部署参数见 [server134 运维说明](deploy/monitoring/README.server134.md)。
2026-10-15 已完成部署和远程冒烟:三类数据读写、8 个采集目标、Grafana 三个数据源及主机仪表盘检查通过。原有两个应用状态接口正常。部署后的磁盘剩余约 45 GiB,具体记录见 [部署验收记录](docs/deployments/2026-10-15-server134.md)。
先通过 SSH 进行只读检查,确认系统、Docker、磁盘空间和端口;已有部署应先备份配置并保留 `.env` 与 `data/`。检查通过后按服务器部署文档执行,必须通过 Metrics、Logs、Traces 冒烟才能确认部署成功。 先通过 SSH 进行只读检查,确认系统、Docker、磁盘空间和端口;已有部署应先备份配置并保留 `.env` 与 `data/`。检查通过后按服务器部署文档执行,必须通过 Metrics、Logs、Traces 冒烟才能确认部署成功。
服务部署成功后,可从工作机建立隧道,使用避开本地应用及本地监控端口的地址: 服务部署成功后,可从工作机建立隧道,使用避开本地应用及本地监控端口的地址:
+2
View File
@@ -20,6 +20,8 @@ GRAFANA_PREINSTALL_PLUGINS=
本次镜像通过工作机导出、SHA256 校验后 `docker load` 导入,因服务器 Docker 镜像代理返回大小校验错误。没有修改 Docker daemon 配置。已预置日志数据源插件 0.32.0,因此此机将 `GRAFANA_PREINSTALL_PLUGINS` 设为空,避免启动时再次联网安装;新机器未预置插件时不要设置此空值。插件签名验证保持启用。 本次镜像通过工作机导出、SHA256 校验后 `docker load` 导入,因服务器 Docker 镜像代理返回大小校验错误。没有修改 Docker daemon 配置。已预置日志数据源插件 0.32.0,因此此机将 `GRAFANA_PREINSTALL_PLUGINS` 设为空,避免启动时再次联网安装;新机器未预置插件时不要设置此空值。插件签名验证保持启用。
通过 Windows 中转插件目录会丢失 Linux 执行权限。导入后需将插件目录属主设为 `472:0`,目录权限 `0755`、普通文件 `0644`,并将 `victoriametrics_logs_backend_plugin_linux_amd64` 设为 `0755`;以 Grafana 日志无插件启动错误且日志数据源健康检查通过为准。
镜像已导入时启动可使用以下命令,不需要重新拉取: 镜像已导入时启动可使用以下命令,不需要重新拉取:
```bash ```bash
+46
View File
@@ -0,0 +1,46 @@
# server134 部署验收记录
部署日期:2026-10-15(Asia/Shanghai)。
## 目标与版本
- 仓库:https://git.weytoken.com/qiubs/observability.git,分支 `main`。
- 服务器:`server134-rot` / `134.175.227.134`,Ubuntu 22.04.5,2 vCPU、7.6 GiB RAM。
- 运行目录:`/opt/observability/`;已部署版本记录于该目录的 `DEPLOYED_COMMIT`。
- 首次代码提交 `f657abe`;支持预置插件启动的提交 `6fe8511`。后续提交补充本记录及空的 Grafana provisioning 目录。
- 旧文件备份:`/opt/observability-backups/before-f657abe.tar.gz`,已验证可列出内容,权限 0600。
## 结果
- 8 个监控容器运行,所有 10 个宿主机发布端口均绑定 127.0.0.1,Grafana 为 3002。
- `bash scripts/smoke-test.sh` 退出码 0:Metrics、Logs、OTLP Trace 的本次写入和查询均通过。
- Grafana VictoriaMetrics、VictoriaLogs、Tempo 数据源健康检查通过,`monitor-host-overview` 仪表盘存在。
- 8 个采集目标均 `up=1`,标签 `env=production`、主机 `server134`;4 条主机告警规则无计算错误,Alertmanager 活动告警为 0。
- 合成 run ID:`f2b2983492f83f83`;Trace ID:`c4c50887907cda3c5721ead9ebd63f01`。
- 原有 3000/3001 应用进程 PID 保持不变,两个 `/api/status` 返回 HTTP 200、`success=true`。
- 未改动原有应用、数据库、nginx、防火墙或 Docker daemon 配置。
- 验收时无 OOM 或重启循环,约 5.2 GiB 内存可用、45 GiB 磁盘可用;此数据为初始空载快照。
## 部署中处理的问题
1. SSH 配置经用户修正后连接成功。
2. 3000/3001 被现有业务占用,新增 `GRAFANA_PORT` 参数,使 Compose、端口检测与冒烟保持一致;服务器设为 3002。
3. 服务器 Docker 镜像代理返回 manifest 大小校验错误,改用本地固定版本镜像导出、上传、SHA256 校验后导入。
4. Grafana 预置 VictoriaLogs 插件 0.32.0,并禁用本机同步联网预安装。Windows 中转丢失了 Linux 执行位,恢复后插件注册与数据源健康检查通过;未关闭签名验证。
5. `.env` 权限为 0600,部署日志不输出 Grafana 初始密码。
镜像归档 SHA256:
```text
observability-images.tar.gz 1c73eba5b8aae52ba8cd5da12e6ae389d5c6a90f4fe96785cadd00e9c265cde5
observability-node.tar 0fdabd05924c58730efe2f0e8be7acd428d0d499d40f8fdee86b4a1dbc8cc8f4
observability-plugin.tar.gz 5f689290f910fda76490f4a0e1e148dff2d86d115784f005ba9f1b56b5d3fa53
```
## 验证边界
当前仅接入 server134 主机及监控栈自身。生产业务质量指标、应用/MySQL 采集、真实日志与链路、企业微信通知尚未接入。合成读写成功不代表已经完成业务接入或高可用验证。
本地静态验证通过 11 个 Python 测试、4 个 Bash 端口测试、Shell 语法、Compose 配置及 YAML/JSON 格式检查。部署期间另行运行 Windows 本地完整冒烟时,合成数据读写通过,但本地 new-api 的 `probe_success=0`,因此该次本地完整冒烟失败;它与远程验收结果分开记录,未修改本地应用。
访问、密码位置和回滚步骤见 [server134 运维说明](../../deploy/monitoring/README.server134.md)。