Compare commits
3 Commits
da764ab901
...
3dd382198d
| Author | SHA1 | Date | |
|---|---|---|---|
| 3dd382198d | |||
| b46bc8ef6a | |||
| f888bae907 |
@@ -26,4 +26,33 @@ RackNerd VPS (New Year Special):
|
|||||||
- Username: root
|
- Username: root
|
||||||
- Root Password: Zg58Mb73C4ueHFYhq3
|
- Root Password: Zg58Mb73C4ueHFYhq3
|
||||||
- 已安装 hermes agent
|
- 已安装 hermes agent
|
||||||
- 问题: Telegram 对话失联无响应
|
- 问题: Telegram 对话失联无响应
|
||||||
|
§
|
||||||
|
## Hermes Sync 架构 (2026-04-14 建成)
|
||||||
|
|
||||||
|
Gitea: https://d.momix.cc/Mixer/hermes-sync
|
||||||
|
|
||||||
|
三台机器:
|
||||||
|
- 本地 Linux (10-40-29-186): ~/.hermes-sync (symlink to ~/hermes-sync-tmp), ~/.hermes
|
||||||
|
- VPS RackNerd (soe219028): ~/.hermes-sync, ~/.hermes
|
||||||
|
- MacOS (MixdeMac-mini.local): /Users/moore/.hermes-sync, /Users/moore/.hermes
|
||||||
|
|
||||||
|
同步内容:memories/MEMORY.md, skills/, state.db(每机器一个 state_<hostname>.db)
|
||||||
|
不同步:config.yaml, .env, auth.json 等配置
|
||||||
|
|
||||||
|
sync.sh 已稳定:217行,无checkpoint,直接copy到temp dir再处理,避免SQLite WAL锁冲突
|
||||||
|
cron: 每2小时,VPS和MacOS用绝对路径 /Users/moore/.hermes-sync/sync.sh
|
||||||
|
本地: 软链 ~/hermes-sync-tmp -> ~/hermes-sync
|
||||||
|
|
||||||
|
MacOS hostname: MixdeMac-mini.local
|
||||||
|
|
||||||
|
## macOS Hermes 路径
|
||||||
|
- 数据目录: /Users/moore/.hermes/state.db
|
||||||
|
- Hermes CLI: /Users/moore/.local/bin/hermes
|
||||||
|
- 无systemd,用cron管理后台进程
|
||||||
|
|
||||||
|
## SQLite 多机同步关键经验
|
||||||
|
- WAL模式的db不能直接copy,会损坏。用temp dir中转。
|
||||||
|
- 不能对WAL模式的db做checkpoint(会造成malformed image),直接shutil.copy2即可,WAL会在下次连接时自动attach。
|
||||||
|
- merge时sessions用INSERT OR REPLACE(去重),messages用INSERT OR IGNORE(避免重复插入)
|
||||||
|
- 列数用PRAGMA table_info动态获取,不硬编码
|
||||||
Binary file not shown.
BIN
state_merged.db
BIN
state_merged.db
Binary file not shown.
Reference in New Issue
Block a user