다중 Gateway (동일 호스트)
대부분의 설정은 하나의 Gateway를 사용해야 합니다. 왜냐하면 단일 Gateway가 여러 메시징 연결과 에이전트를 처리할 수 있기 때문입니다. 더 강력한 격리 또는 중복성이 필요한 경우(예: 구조 봇), 격리된 프로필/포트로 별도의 Gateway를 실행하세요.
격리 체크리스트 (필수)
- OPENCLAW_CONFIG_PATH — 인스턴스별 설정 파일
- OPENCLAW_STATE_DIR — 인스턴스별 세션, 자격 증명, 캐시
- agents.defaults.workspace — 인스턴스별 워크스페이스 루트
- gateway.port (또는 --port) — 인스턴스별 고유
- 파생 포트 (browser/canvas)는 겹치지 않아야 함
이것들이 공유되면 설정 경합과 포트 충돌이 발생합니다.
권장: 프로필 (--profile)
프로필은 OPENCLAW_STATE_DIR + OPENCLAW_CONFIG_PATH를 자동으로 범위 지정하고 서비스 이름에 접미사를 붙입니다.
# main
openclaw --profile main setup
openclaw --profile main gateway --port 18789
# rescue
openclaw --profile rescue setup
openclaw --profile rescue gateway --port 19001
프로필별 서비스:
openclaw --profile main gateway install
openclaw --profile rescue gateway install
구조 봇 가이드
동일한 호스트에서 자체적으로 다음을 갖춘 두 번째 Gateway를 실행하세요:
- 프로필/설정
- 상태 디렉토리
- 워크스페이스
- 베이스 포트 (및 파생 포트)
이렇게 하면 구조 봇이 메인 봇과 격리되어 주 봇이 다운되었을 때 디버그하거나 설정 변경 사항을 적용할 수 있습니다.
포트 간격: 베이스 포트 사이에 최소 20개의 포트를 남겨서 파생된 browser/canvas/CDP 포트가 절대 충돌하지 않도록 하세요.
설치 방법 (구조 봇)
# Main bot (existing or fresh, without --profile param)
# Runs on port 18789 + Chrome CDC/Canvas/... Ports
openclaw onboard
openclaw gateway install
# Rescue bot (isolated profile + ports)
openclaw --profile rescue onboard
# Notes:
# - workspace name will be postfixed with -rescue per default
# - Port should be at least 18789 + 20 Ports,
# better choose completely different base port, like 19789,
# - rest of the onboarding is the same as normal
# To install the service (if not happened automatically during onboarding)
openclaw --profile rescue gateway install
포트 매핑 (파생)
베이스 포트 = gateway.port (또는 OPENCLAW_GATEWAY_PORT / --port).
- browser control service 포트 = 베이스 + 2 (루프백 전용)
- canvasHost.port = 베이스 + 4
- Browser 프로필 CDP 포트는 browser.controlPort + 9 .. + 108에서 자동 할당
설정이나 env에서 이들 중 하나를 재정의하는 경우 인스턴스별로 고유하게 유지해야 합니다.
Browser/CDP 노트 (일반적인 실수)
- 여러 인스턴스에서 동일한 값으로 browser.cdpUrl을 고정하지 마십시오.
- 각 인스턴스는 자체 browser control 포트와 CDP 범위가 필요합니다 (gateway 포트에서 파생됨).
- 명시적 CDP 포트가 필요한 경우 인스턴스별로 browser.profiles.<name>.cdpPort를 설정하세요.
- 원격 Chrome: 인스턴스별, 프로필별로 browser.profiles.<name>.cdpUrl 사용.
수동 env 예제
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
빠른 확인
openclaw --profile main status
openclaw --profile rescue status
openclaw --profile rescue browser status