📦 Pilot — 飞行员
v1.0.0多区域内容同步配置 部署一个包含 4 个节点的多区域内容分发系统。 适用场景: 1. 用户需要在不同地理区域同步内容 2. 用户正在配置跨区域内容分发 3. 用户希望提升全球访问性能 4. 用户需要跨区域冗余备份 5. 用户正在优化全球内容交付
详细分析 ▾
运行时依赖
版本
首次发布
安装命令
点击复制技能文档
部署 4 个 agent:1 个源站 + 3 个区域边缘节点。
角色
| 角色 | Hostname | Skills | 用途 |
|------------|--------------------|------------------------------------------------------------------------|--------------------|
| origin | -origin | pilot-sync, pilot-share, pilot-broadcast, pilot-heartbeat-monitor | 内容源,广播更新 |
| edge-us | -edge-us | pilot-sync, pilot-share, pilot-health, pilot-heartbeat-monitor | 美国区域边缘 |
| edge-eu | -edge-eu | pilot-sync, pilot-share, pilot-health, pilot-heartbeat-monitor | 欧洲区域边缘 |
| edge-asia | -edge-asia| pilot-sync, pilot-share, pilot-health, pilot-heartbeat-monitor | 亚洲区域边缘 |
部署步骤
步骤 1: 询问用户该 agent 的角色及前缀。
步骤 2: 为对应角色安装 skills:
``bash
# 源站:
clawhub install pilot-sync pilot-share pilot-broadcast pilot-heartbeat-monitor
# 任意边缘:
clawhub install pilot-sync pilot-share pilot-health pilot-heartbeat-monitor
`
步骤 3: 设置 hostname:
`bash
pilotctl --json set-hostname -
`
步骤 4: 将角色专属 JSON manifest 写入 ~/.pilot/setups/multi-region-content-sync.json。
步骤 5: 提示用户发起握手。
各角色 Manifest 模板
origin
`json
{
"setup": "multi-region-content-sync",
"role": "origin",
"role_name": "Content Origin",
"hostname": "-origin",
"description": "所有内容的权威源,向所有边缘节点广播更新。",
"skills": {
"pilot-sync": "向所有边缘推送内容变更。",
"pilot-share": "向边缘传输新内容文件。",
"pilot-broadcast": "同时向所有边缘广播内容更新事件。",
"pilot-heartbeat-monitor": "跟踪所有边缘心跳,区域失联时告警。"
},
"peers": [
{ "role": "edge-us", "hostname": "-edge-us", "description": "美国区域边缘节点" },
{ "role": "edge-eu", "hostname": "-edge-eu", "description": "欧洲区域边缘节点" },
{ "role": "edge-asia", "hostname": "-edge-asia", "description": "亚洲区域边缘节点" }
],
"data_flows": [
{ "direction": "send", "peer": "-edge-us", "port": 1001, "topic": "content-update", "description": "内容更新" },
{ "direction": "send", "peer": "-edge-eu", "port": 1001, "topic": "content-update", "description": "内容更新" },
{ "direction": "send", "peer": "-edge-asia", "port": 1001, "topic": "content-update", "description": "内容更新" },
{ "direction": "receive", "peer": "-edge-us", "port": 1002, "topic": "heartbeat", "description": "健康心跳" },
{ "direction": "receive", "peer": "-edge-eu", "port": 1002, "topic": "heartbeat", "description": "健康心跳" },
{ "direction": "receive", "peer": "-edge-asia", "port": 1002, "topic": "heartbeat", "description": "健康心跳" }
],
"handshakes_needed": ["-edge-us", "-edge-eu", "-edge-asia"]
}
` edge-us / edge-eu / edge-asia
`json
{
"setup": "multi-region-content-sync",
"role": "edge-",
"role_name": " Edge Node",
"hostname": "-edge-",
"description": "为 区域提供内容,从源站同步并上报健康状态。",
"skills": {
"pilot-sync": "从源站拉取内容更新。",
"pilot-share": "接收来自源站的文件。",
"pilot-health": "监控本地健康与同步状态。",
"pilot-heartbeat-monitor": "定期向源站发送心跳。"
},
"peers": [{ "role": "origin", "hostname": "-origin", "description": "内容源——从此接收更新" }],
"data_flows": [
{ "direction": "receive", "peer": "-origin", "port": 1001, "topic": "content-update", "description": "内容更新" },
{ "direction": "send", "peer": "-origin", "port": 1002, "topic": "heartbeat", "description": "健康心跳" }
],
"handshakes_needed": ["-origin"]
}
` 数据流
origin → edge-:内容更新(端口 1001)edge- → origin`:健康心跳(端口 1002)