我在排查 Linux 服务器时使用的思维清单

发布: (2025年12月21日 GMT+8 03:09)
3 min read
原文: Dev.to

Source: Dev.to

步骤 1:出了什么问题?

  • Service not running? → 服务未运行?
  • Server unreachable? → 服务器无法访问?
  • Performance issue? → 性能问题?
  • Permission issue? → 权限问题?
  • Always define failure first始终先定义故障

步骤 2:系统是否存活?

  • Can I SSH in? → 我能 SSH 进去吗?
  • Is the server responsive? → 服务器是否有响应?
  • Is the disk full? → 磁盘是否已满?
  • Is RAM exhausted? → 内存是否耗尽?

步骤 3:服务是否在运行?

  • Is the process running? → 进程是否在运行?
  • Did it fail to start? → 启动是否失败?
  • Did it crash? → 是否崩溃?
  • This eliminates 50 % of issues这可以排除 50% 的问题

步骤 4:检查日志

  • Why it failed → 为何失败
  • What it tried to do → 它尝试做了什么
  • What it couldn’t access → 它无法访问的内容
  • Learn to scan logs, not read every line学会扫描日志,而不是阅读每一行

步骤 5:最近有什么变化?

  • Updates → 更新
  • Config edits → 配置编辑
  • Permission changes → 权限更改
  • New files → 新文件
  • Always ask: what changed?始终问:有什么变化?

步骤 6:缩小范围

  • Is it one user or all users? → 是单个用户还是所有用户?
  • One service or the whole system? → 单个服务还是整个系统?
  • One port or all networking? → 单个端口还是全部网络?
  • This prevents panic这可以防止恐慌

步骤 7:一次只测试一件事

  • Make a small change → 进行小幅修改
  • Restart service → 重启服务
  • Observe → 观察
  • Never shotgun‑fix永不盲目修复

步骤 8:确认并记录

  • Is it fixed? → 已修复吗?
  • Why? → 为什么?
  • What would I do faster next time? → 下次我会如何更快处理?
  • That’s real troubleshooting这才是真正的故障排除
Back to Blog

相关文章

阅读更多 »