AgentFS(測試版) 實戰指南
NFS 伺服器存取
透過 NFS 將 AgentFS 匯出到網路上
AgentFS 可以透過 NFS 公開檔案系統,讓其他機器、容器或虛擬機器進行遠端存取。
啟動 NFS 伺服器
agentfs serve nfs my-agent
根據預設,它會監聽 127.0.0.1:11111。
綁定到所有網路介面
若要允許遠端存取:
agentfs serve nfs my-agent --bind 0.0.0.0 --port 2049
警告
在 0.0.0.0 上公開 NFS 會讓任何能連線到您機器的人都能存取該檔案系統。在正式環境部署時,請使用防火牆規則或 VPN。
掛載檔案系統
從同一台機器
mkdir /mnt/agentfs
mount -t nfs -o vers=3,tcp,port=11111,mountport=11111,nolock 127.0.0.1:/ /mnt/agentfs
從遠端機器
mount -t nfs -o vers=3,tcp,port=2049,mountport=2049,nolock server-ip:/ /mnt/agentfs
掛載選項說明
| 選項 | 說明 |
|---|---|
vers=3 |
使用 NFSv3 協定 |
tcp |
使用 TCP 傳輸 |
port=11111 |
NFS 伺服器連接埠 |
mountport=11111 |
掛載協定連接埠 |
nolock |
停用檔案鎖定(單一使用者) |
卸載
umount /mnt/agentfs
如果掛載忙碌中:
umount -f /mnt/agentfs # 強制卸載
# or
umount -l /mnt/agentfs # 延遲卸載
後續步驟
同步自官方 Turso 文件倉庫 (
tursodatabase/turso-docs
· MIT 開源授權)
檢視官方原文 ↗