这是系列的第二部分,2台OpenClaw+多台电脑基于Tailscale连接在一起工作(上)已经完成将主Gateway加入到Tailscale并实现可以在其他电脑上访问。
接下来将迷你主机上的OpenClaw以Node形式加入到OpenClaw集群种。
最终实现的效果是:
请添加图片描述

总结下来其实就2步

需要先通过ssh命令建立ssh隧道通信,才能更快完成。

  • ssh -N -L 命令建立通信
  • openclaw node run 启动Node

Unbuntu上开启ssh服务

检查OpenClaw主Gateway机器上的服务是否开启:

sudo systemctl status ssh
# Unit ssh.service could not be found.
# 安装ssh
sudo apt update 
sudo apt install openssh-server
# 确认ssh状态
sudo systemctl status ssh
# ○ ssh.service - OpenBSD Secure Shell server
#     Loaded: loaded (/usr/lib/systemd/system/ssh.service; disabled; preset: enabled)
#     Active: inactive (dead)
# TriggeredBy: ● ssh.socket
#       Docs: man:sshd(8)
#             man:sshd_config(5)

Windows Node Host 配置

回到Node(迷你主机)上执行:

ssh -N -L 18789:localhost:18789 user@xxxx.tailxxxx.ts.net
# The authenticity of host 'user@xxxx.tailxxxx.ts.net (100.xxx.xxx.xxx)' can't be established.
# EDxxx key fingerprint is SHA256:p6OX+xxxxxx.
# This key is not known by any other names
# Are you sure you want to continue connecting (yes/no/[fingerprint])?
yes
# 输入正确的密码后链路建立

新开一个窗口:

# 设置环境变量(Gateway 的 token)
$env:OPENCLAW_GATEWAY_TOKEN = "你的Ubuntu-Gateway-token"

# 启动 Node Host(使用localhost ssh 通道)
openclaw node run --host localhost --port 18789 --display-name "Windows-Node"

确认状态

在Ubuntu上执行openclaw nodes status,成功:
请添加图片描述
在Gateway的Nodes也可以看到
请添加图片描述

安装过程的报错记录

助理无法访问

node host gateway connect failed: SECURITY ERROR: Cannot connect to "ubuntu1.tailf64152.ts.net" over plaintext ws://. Both credentials and chat data would be exposed to network interception. Use wss:// for the gateway URL, or connect via SSH tunnel to localhost.
openclaw config set gateway.mode remote
openclaw config set gateway.remote.url wss://ubuntu1.tailf64152.ts.net:18789

在Node服务器上执行:


ssh -N -L 18789:localhost:18789 tinygone@ubuntu1.tailf64152.ts.net
# ssh: connect to host ubuntu1.tailf64152.ts.net port 22: Connection refused

Ubuntu 上批准 Node 配对

Node Host 连接后,Ubuntu 会收到配对请求,这一步我没做,但可以用openclaw nodes status查看状态:

# 查看待批准的请求
openclaw nodes pending

# 批准
openclaw nodes approve <requestId>

# 查看已配对的节点
openclaw nodes status

关键词:OpenClaw, Tailscale,Gateway, Node,一主一从

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐