复数 Gateway
Run multiple OpenClaw Gateways on one host (isolation, ports, and profiles)
大多数设置应该使用一个网关,因为单个网关可以处理多个消息连接和代理。如果您需要更强的隔离或冗余(例如,救援机器人),请运行具有隔离配置文件/端口的单独网关。
分钟離检查列表(必须)
- ''OPENCLAW_CONFIG_PATH'' — 实示例每个设置文件
- ''OPENCLAW_STATE_DIR'' — per-instance sessions, creds, caches
- ''agents.defaults.workspace'' — per-instance workspace root
- ''gateway.port'' (或 ''--port'') — 实示例每个唯一
- Derived ports (browser/canvas) must not overlap
这些但分钟享如果已被、设置的冲突和端口的冲突但発生执行。
Recommended: profiles (`--profile`)
Profiles auto-scope ''OPENCLAW_STATE_DIR'' + ''OPENCLAW_CONFIG_PATH'' and suffix service names.
openclaw --profile main setup openclaw --profile main gateway --port 18789 openclaw --profile rescue setup openclaw --profile rescue gateway --port 19001
Per-profile services:
openclaw --profile main gateway install openclaw --profile rescue gateway install
Rescue-bot guide
同自主机在独自的也的持次 2 番目的网关运行执行:
- profile/config
- 状態目录
- 工作区
- base port (plus derived ports)
这可以将救援机器人与主机器人隔离,以便在主机器人宕机时可以调试或应用配置更改。
Port spacing: leave at least 20 ports between base ports so the derived browser/canvas/CDP ports never collide.
#
How to install (rescue bot)
openclaw onboard openclaw gateway install openclaw --profile rescue onboard openclaw --profile rescue gateway install
Port mapping (derived)
基础端口 = ''gateway.port''(或 ''OPENCLAW_GATEWAY_PORT'' / ''--port'')。
- browser control service port = base + 2 (loopback only)
- ''canvasHost.port = base + 4''
- Browser profile CDP ports auto-allocate from ''browser.controlPort + 9 .. + 108''
如果您在配置或环境变量中覆盖其中任何一项,则必须确保每个实例的唯一性。
Browser/CDP notes (common footgun)
- Do ''not'' pin ''browser.cdpUrl'' to the same values on multiple instances.
- 每个实示例是、独自的浏览器控制端口和 CDP 範囲(网关端口从派生)需要。
- 明示的那 CDP 端口需要那場合是、每个实示例在 ''browser.profiles.'' 设置执行。
- Remote Chrome: use ''browser.profiles.'' (per profile, per instance).
手动环境变量的示示例
OPENCLAW_CONFIG_PATH=~/.openclaw/main.json \ OPENCLAW_STATE_DIR=~/.openclaw-main \ openclaw gateway --port 18789 OPENCLAW_CONFIG_PATH=~/.openclaw/rescue.json \ OPENCLAW_STATE_DIR=~/.openclaw-rescue \ openclaw gateway --port 19001
Quick checks
openclaw --profile main status openclaw --profile rescue status openclaw --profile rescue browser status