Safety

运维

9分钟

用 update、doctor、status、logs、backup、usage checks、release hygiene 和故障排查习惯长期运行 OpenClaw。

长期运行 OpenClaw 是运维问题:Gateway 要健康,凭证要有效,渠道要在线,记忆要可搜索,自动化要可理解。

日常命令

bash
openclaw status
openclaw gateway status
openclaw channels status
openclaw doctor

多数问题都会先表现为 Gateway health、channel login、model auth 或 plugin readiness。

日志

bash
openclaw logs
openclaw logs --follow

调试特定 channel 或 plugin:

bash
openclaw channels status --probe
openclaw plugins doctor <plugin>

更新

bash
openclaw update
openclaw doctor
openclaw gateway status

如果通过 npm/pnpm 安装,也可以用包管理器:

bash
npm install -g openclaw@latest
openclaw doctor

更新后验证 model auth、channel status、plugins 和 recurring automation。

备份

bash
openclaw backup create --verify
openclaw backup verify ./2026-03-09T08-00-00.000+08-00-openclaw-backup.tar.gz

人类编写的 workspace 文件也应进入版本控制。不要提交 channel state、browser profiles、auth tokens 或 private transcripts。

用量与成本

bash
openclaw status --usage
openclaw sessions list --usage

聊天中也可以:

text
/usage tokens
/usage full

按层排查

现象先看
Dashboard 打不开openclaw gateway status、bind/auth
模型不回复openclaw models status、credential profile
渠道收到但不回复pairing、routing、群聊 activation、agent busy
工具缺失tool policy、provider restrictions、plugin availability
浏览器失败browser status、profile、CDP、sandbox network
自动化未运行cron/task status、credentials、session isolation
记忆不对MEMORY.md、daily notes、session、compaction、QMD index、active memory
节点失败device pairing、node status、permissions

修改配置后的 Smoke Test

bash
openclaw doctor
openclaw gateway status
openclaw agent --agent main --message "Reply with a one-sentence health check."
openclaw status --usage

Operational Habits

  1. 一次只改一层。
  2. 大型配置变更前保留备份。
  3. 优先用 CLI status,而不是从聊天行为猜测。
  4. 更新后重新跑 doctor
  5. 让自动化保持可观测。
  6. 更新后审查 plugins。
  7. 记录 channel bindings 和 Agent ownership。

运维 Gateway,而不只是模型

OpenClaw 出问题时,模型经常不是根因。分层检查 Gateway、渠道、认证、插件、工具策略、沙盒和会话。

继续实践

运维 的核心概念已经读完

如果你想把理解变成可复用的能力,可以到 AgentWay 继续练习