取证
取证
systemctl status <服务> | head -30 # 看 NRestarts 计数
docker inspect --format '{{.RestartCount}} {{.State.OOMKilled}}' <容器>
journalctl -u <服务> -n 200 --no-pager | tail -50| 退出码 137 | 常为 SIGKILL:优先怀疑 OOM 或组件超时杀 |
|---|---|
| 退出码 1 | 应用异常退出:看 traceback 首段 |
| 退出码 143 | 收到 SIGTERM:先查是谁在发信号 |
| OOMKilled=true | 容器被内核杀:核对 cgroup 内存限额 |
排查期间临时把 Restart 策略收敛(on-failure 且设上限)或停掉 unit,防止刷屏与反复抢占 GPU。