nfs-ganesha 编译运行

nfs-ganesha dep

apt install gcc g++ gdb cmake libkrb5-dev
apt install bison flex doxygen
apt install lsb-release
apt install uuid-dev
apt install doxygen
apt install libcap-dev libblkid-dev
apt install git
apt install nfs-common 

compile

git clone https://github.com/nfs-ganesha/nfs-ganesha
git checkout V2.7.6
git submodule update --init --recursive

cmake .. -DUSE_9P=OFF -DUSE_NLM=OFF
make

ganesha.conf(for NFS4.1)

EXPORT
{
    Export_Id = 77;
    Path = /opt;
    Pseudo = /;

    FSAL {
        Name = VFS;
    }
    Access_Type = RW;
    Disable_ACL = true;
    Squash = No_Root_Squash;
    Protocols = 4;
}
EXPORT_DEFAULTS{
    Transports = UDP, TCP;
    SecType = sys;
}

ganesha.conf(for NFS3)

EXPORT_DEFAULTS
{
    SecType = sys;
    Protocols = 3;
}
NFS_CORE_PARAM
{
    Enable_NLM = false;
    Enable_RQUOTA = false;
    Protocols = 3;
    mount_path_pseudo = true;
}
EXPORT
{
    Export_ID=100;
    Protocols = 3;
    Transports = TCP,UDP;
    Path = /opt;
    Pseudo = /opt;
    Tag = ceph;
    Access_Type = RW;
    Attr_Expiration_Time = 0;
    Squash = None;
    FSAL {
        Name = VFS;
    }
}

run

/usr/bin/ganesha.nfsd -F -L /dev/stdout -f ~/ganesha.conf -N NIV_EVENT
/usr/bin/ganesha.nfsd -f ~/ganesha.conf

mount -t nfs -o nfsvers=3 localhost:/ /mnt/test
mount -t nfs4 -ominorversion=1 localhost:/ /mnt/test
mount -t nfs4 -ominorversion=1 -onoac localhost:/ /mnt/test

nfs内核属性

cat /proc/self/mountinfo
cat /proc/self/mounts
cat /proc/self/mountstats
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容