Files
AgentsMeeting/docs/DEPLOY.md
T

141 lines
4.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# AgentsMeeting — 部署指南
> 版本: v2.1 | 日期: 2026-07-19
---
## 部署概览
| 组件 | 平台 | 守护 | 端口 |
|------|------|------|------|
| **Dashboard** | Linux (192.168.1.246) | systemd `agentsmeeting-dashboard` | 5803 |
| **health_check (Tier1)** | Linux (192.168.1.246) | crontab `*/5 * * * *` | — |
| **daily_health (Tier2)** | Linux (192.168.1.246) | crontab `0 8 * * *` | — |
| **todo_executor** | Linux (192.168.1.246) | crontab `*/10 * * * *` | — |
| **auto_heal** | Linux (192.168.1.246) | crontab `*/5 * * * *` | — |
| **xmpp_bot (xxm)** | Windows (192.168.1.16) | watchdog (30s) | 5802 |
| **wechat_agent** | Windows (192.168.1.16) | 内置看门狗 | 5801, 19088 |
| **api_proxy** | Windows (192.168.1.16) | watchdog | 8787 |
| **watchdog** | Windows (192.168.1.16) | 自身 | — |
| **ejabberd** | Linux Docker (192.168.1.246) | Docker restart policy | 5222 |
| **hermes-gateway** | Linux (192.168.1.246) | systemd | 8642, 8643, 8645 |
| **mohe/xiaoguo/zhiwei bots** | Linux/Mac | systemd | — |
---
## 1. Linux 端 (192.168.1.246)
### 1.1 Dashboard
```bash
# 服务文件: /etc/systemd/system/agentsmeeting-dashboard.service
sudo systemctl status agentsmeeting-dashboard
sudo systemctl restart agentsmeeting-dashboard
# 日志
sudo journalctl -u agentsmeeting-dashboard -f
# 访问: http://192.168.1.246:5803
```
### 1.2 ejabberd
```bash
cd /opt/ejabberd
docker compose restart
docker exec ejabberd ejabberdctl connected_users
```
### 1.3 健康监控管线
```bash
# 添加到 crontab
(crontab -l 2>/dev/null; echo '# AgentsMeeting health pipeline'; echo '*/5 * * * * cd /home/hmo/AgentsMeeting/gateway/scripts && /usr/bin/python3 agents_health_check.py >> ../logs/health_check.log 2>&1'; echo '0 8 * * * cd /home/hmo/AgentsMeeting/gateway/scripts && /usr/bin/python3 agents_daily_health.py >> ../logs/daily_health.log 2>&1'; echo '*/10 * * * * cd /home/hmo/AgentsMeeting/gateway/scripts && /usr/bin/python3 self_todo_executor.py >> ../logs/todo_executor.log 2>&1') | crontab -
# 验证
crontab -l | grep health
python3 gateway/scripts/agents_health_check.py # 手动跑一次,无输出=全正常
```
> 详见 `docs/HEALTH-PIPELINE.md`
### 1.4 防火墙
```bash
sudo ufw status | grep -E '5803|5802'
# Dashboard: 5803
# xmpp_bot bridge: 5802 (from Windows)
```
---
## 2. Windows 端 (192.168.1.16)
### 2.1 前置条件
- Python 3.10: `C:\Users\hmo\AppData\Local\Programs\Python\Python310\python.exe`
- pip 包: `slixmpp`, `flask`, `pyyaml`, `requests`
### 2.2 一键部署
```powershell
cd D:\F\NewI\opencode\daily-workspace\projects\AgentsMeeting
powershell -File deploy\windows\start.ps1
```
自动完成:停止旧进程 → api_proxy → wechat_agent → xmpp_bot → watchdog
### 2.3 验证
```powershell
powershell -File deploy\windows\check.ps1
```
预期输出:
```
xmpp_bot: RUNNING (PID xxxx)
http_bridge: OK (N msgs)
wechat_agent: RUNNING (PID xxxx)
watchdog: RUNNING (PID xxxx)
api_proxy: RUNNING (:8787)
dashboard: http://192.168.1.246:5803
```
---
## 3. 人类客户端
| 客户端 | 平台 | 配置 |
|--------|------|------|
| Gajim | Windows/Linux | 服务器 `xmpp.yoin.fun`,端口 `3021`STARTTLS |
| Conversations | Android | 同上 |
| Monal | iOS | 同上 |
群聊:`coregroup@conference.yoin.fun`
---
## 4. 网络拓扑
```
Windows (192.168.1.16) Linux (192.168.1.246)
───────────────────────── ────────────────────────
xmpp_bot :5802 ──────────────► Dashboard :5803
wechat_agent :5801 ──health──► Docker ejabberd :5222
api_proxy :8787 hermes-gateway :8642
frpc tunnel ──► Alibaba Cloud (47.115.32.206)
└─ frps :3021 → XMPP traffic
```
---
## 5. 故障恢复
| 问题 | 命令 |
|------|------|
| Dashboard 挂了 | `ssh hmo@192.168.1.246 "sudo systemctl restart agentsmeeting-dashboard"` |
| xmpp_bot 挂了 | `powershell -File deploy\windows\start.ps1` watchdog 30s 自动重启) |
| ejabberd 挂了 | `ssh hmo@192.168.1.246 "cd /opt/ejabberd && docker compose restart"` |
| 全部瘫了 | 先 Linux: `docker compose restart` + `systemctl restart agentsmeeting-dashboard`,再 Windows: `start.ps1` |