跳至正文内容
TursoDB.cn 独立社区 · MVCC 并发写与每 Agent 独立库实战 阅读解析 →
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  # 强制卸载
# 或
umount -l /mnt/agentfs  # 延迟卸载

后续步骤

同步自官方 Turso 文档仓库 ( tursodatabase/turso-docs · MIT 开源协议) 查看官方原文 ↗
搜索
按 Esc 关闭 · 由 Pagefind 静态索引驱动