NFS ganesha 搭建

好风 发表于 2017-08-08T23:55:47.127446Z
引用地址:https://plus.ooclab.com/note/article/1379

https://github.com/nfs-ganesha/nfs-ganesha

OS环境为 CentOS 7.3 x86_64

安装必要软件包

yum install -y nfs-ganesha nfs-ganesha-vfs

编辑配置文件 /etc/ganesha/ganesha.conf :

EXPORT
{
        # Export Id (mandatory, each EXPORT must have a unique Export_Id)
        Export_Id = 1;

        # Exported path (mandatory)
        Path = /data;

        # Pseudo Path (required for NFS v4)
        Pseudo = /data;

        # Required for access (default is None)
        # Could use CLIENT blocks instead
        Access_Type = RW;

        Squash = No_root_squash;

        # Exporting FSAL
        FSAL {
                Name = VFS;
        }
}

重启服务:

systemctl restart nfs-ganesha

查看 exports :

# showmount -e localhost
Export list for localhost:
/data (everyone)

在其他节点挂载:

mount -t nfs 10.30.109.199:/data /mnt

注意 其他节点需要安装 nfs-utils (提供 mount.nfs , showmount 工具)

yum install -y nfs-utils

FAQ

遇见问题排查思路

查看 /var/log/ganesha.log 日志文件,仔细关注整个启动过程(不是仅仅 tail -f), 我遇到的一个问题是没有安装 nfs-ganesha-vfs 组件,启动过程中报了如下错误:

09/08/2017 07:41:50 : epoch 598a4c3e : s1-ooclab : ganesha.nfsd-13697[main] load_fsal :NFS STARTUP :CRIT :Could not dlopen module:/usr/lib64/ganesha/libfsalvfs.so Error:/usr/lib64/ganesha/libfsalvfs.so: cannot open shared object file: No such file or directory

参考

  • https://github.com/nfs-ganesha/nfs-ganesha/blob/master/src/config_samples/export.txt