首页/系统/信创系统运维速查/上线验证:服务状态与端口核对
服务与运维65 条

上线验证:服务状态与端口核对

服务 running 不代表业务可用:用 ss 核对监听地址与端口,本机 curl 或 telnet 实测,再看 journal 启动日志,构成最小验证闭环。

信创系统运维速查系统更新于 2026-10-12

验证命令

验证命令
systemctl is-active myapp && ss -lntp | grep -E ':8080|:443'
curl -sS -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8080/healthz
ss -lntup | grep 8080     # 含 UDP
ss -s                     # 连接总量概览
监听在 127.0.0.1 还是 0.0.0.0 决定外部可达性;反代报 502 时先在本机 curl 服务端口做首段定位。

易错点

  • 只查 is-active 会漏掉进程活着但端口未监听的情况,状态与端口两个都要看
  • UDP 服务用 ss -lunp;旧 netstat 字段支持差,新系统统一用 ss

数据来源与参考

  • man 8 ss(iproute2)
  • man 1 curl
​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌