问题描述
NFS-Ganesha 是个 NFS Server 的实现,它运行在用户态空间,它具有的一个功能是:支持 CephFS FSAL(File System Abstraction Layer,文件系统抽象层)特性,其利用 libcephfs 库,将 CephFS 重新导出为 NFS 服务;
NFS 是类 UNIX 系统中最流行的网络共享文件系统之一,所以,即使是不支持 CephFS 文件系统的类 UNIX 系统,也可以通过 NFS 来访问 Ceph 文件系统;
解决方案
for Debian 11 (bullseye)
apt-get install -y nfs-ganesha nfs-ganesha-ceph
systemctl enable rpcbind.service && systemctl start rpcbind.service
cat > /etc/ganesha/ganesha.conf <<EOF
EXPORT {
Export_ID = 1;
Path = "/";
Pseudo = "/";
Access_Type = RW;
NFS_Protocols = "3";
Squash = No_Root_Squash;
Transport_Protocols = TCP;
SecType = "none";
FSAL {
Name = CEPH;
}
}
EOF
systemctl restart nfs-ganesha.service
systemctl status nfs-ganesha.service
# showmount -e 127.0.0.1
Export list for 127.0.0.1:
/ (everyone)
Q:为什么不需要在 NFS Ganesha 中进行与 Ceph 相关的配置?
A:演示目的,我们 NFS Ganesha 直接部署在 Ceph Node 中,所以 NFS Ganesha 能够找到 Ceph 默认配置信息;