网关运行手册

网关运行手册

本页面用于网关服务的 day-1 启动和 day-2 运维。

5 分钟本地启动

1

启动网关

openclaw gateway --port 18789
# debug/trace 镜像到标准输出
openclaw gateway --port 18789 --verbose
# 强制终止选定端口上的监听器,然后启动
openclaw gateway --force
2

验证服务健康

openclaw gateway status
openclaw status
openclaw logs --follow

健康基线:Runtime: runningRPC probe: ok

3

打开控制 UI

openclaw dashboard

在浏览器中打开 http://localhost:18789/openclaw

日常运维

检查网关状态

# 完整状态
openclaw gateway status

# 快速健康检查
openclaw health

# 查看日志
openclaw logs --tail 100

重启网关

# 优雅重启
openclaw gateway restart

# 强制重启
openclaw gateway restart --force

配置管理

# 查看当前配置
openclaw gateway config.get

# 应用配置
openclaw gateway config.apply /path/to/config.json

# 补丁配置
openclaw gateway config.patch '{"agents": {"defaults": {"model": {"primary": "anthropic/claude-3.5-sonnet"}}}}'

生产部署

作为系统服务运行

macOS:

openclaw gateway install-daemon

Linux (systemd):

openclaw gateway install-daemon --user

健康检查端点

网关提供 HTTP 健康检查:

curl http://localhost:18789/health

响应示例:

{
  "status": "ok",
  "uptime": "2h15m",
  "agents": 3,
  "channels": 2
}

故障排除

  • 查看 故障排除 获取详细的诊断步骤
  • 查看 配置 获取配置选项
  • 查看 日志 了解日志格式和位置

相关文档: