十二、常见问题
1. 安装成功但页面无法访问
curl -I http://127.0.0.1:8100/
ss -lntp | grep ':8100'
docker ps --filter name=caddy
docker logs --tail 200 caddy
若本机正常但客户端无法访问,检查外部防火墙、安全组、路由和代理。
2. 登录后首页白屏
curl -fsS http://127.0.0.1:8210/healthz
docker ps --filter name=app-frontend
docker logs --tail 200 app-frontend
docker logs --tail 200 caddy
确认外部代理不仅代理 /,还应原样转发前端子路由和静态资源路径。
3. 插件安装失败
检查插件包顶层目录和 manifest:
tar -tzf <插件包.tgz> | head
tar -xOzf <插件包.tgz> <插件名>/manifest
bash ${CMP_INSTALL_ROOT}shell/plugin_manager.sh order
常见原因包括:包内有多个顶层目录、服务名称不一致、存在多个 jar、依赖服务未安装或健康检查未通过。
4. 容器反复重启或 unhealthy
docker inspect <容器名> --format '{{json .State.Health}}'
docker logs --since 30m <容器名>
docker stats --no-stream
df -h
free -h
代理环境还需确认容器访问 127.0.0.1 时没有被错误送往 HTTP 代理。
5. HA VIP 不存在
在 node1、node2 检查:
docker ps --filter name=keepalive
docker logs --tail 200 keepalive
ip addr
cat ${CMP_INSTALL_ROOT}conf/keepalive/keepalived/keepalived.conf
确认 node1 与 node2 网络互通、VIP 未被占用、网卡选择正确,并检查 ${CMP_INSTALL_ROOT}shell/ha-scripts/healthcheck_scripts.sh 的健康检查结果。
6. 告警没有显示
告警链路分为规则计算、Alertmanager 接收和业务回调三步,不能只看页面判断是否触发:
curl -fsS http://127.0.0.1:8880/api/v1/rules
curl -fsS http://127.0.0.1:9093/api/v2/alerts
docker logs --since 30m vmalert
docker logs --since 30m alertmanager
7. 获取支持日志
不要直接移动或删除正在写入的日志。建议复制所需时间段的文件并压缩:
tar -czf /root/cmp-logs-$(date +%Y%m%d%H%M%S).tgz \
${CMP_INSTALL_ROOT}logs /tmp/cmp.log /tmp/cmp_ha.log 2>/dev/null
提交问题时同时提供:
- 问题发生时间;
- 环境类型(单节点或 HA);
- CMP 版本和安装路径;
- 节点 IP 与 VIP;
- 复现步骤;
cmp-ctl status、cmp-ctl inspection输出;- 相关容器日志和安装日志。
