CentOS 8
Sponsored Link

Ceph Octopus : CephFS + NFS-Ganesha
2020/07/06
 
Install NFS-Ganesha to mount Ceph File System with NFS protocol.
[1] Install and Configure NFS-Ganesha on CephFS Node.
[root@node01 ~]#
dnf -y install centos-release-nfs-ganesha30
[root@node01 ~]#
sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-NFS-Ganesha-3.repo
[root@node01 ~]#
dnf --enablerepo=centos-nfs-ganesha3 -y install nfs-ganesha-ceph
[root@node01 ~]#
mv /etc/ganesha/ganesha.conf /etc/ganesha/ganesha.conf.org

[root@node01 ~]#
vi /etc/ganesha/ganesha.conf
# create new

NFS_CORE_PARAM {
    # disable NLM
    Enable_NLM = false;
    # disable RQUOTA (not suported on CephFS)
    Enable_RQUOTA = false;
    # NFS protocol
    Protocols = 4;
}
EXPORT_DEFAULTS {
    # default access mode
    Access_Type = RW;
}
EXPORT {
    # uniq ID
    Export_Id = 101;
    # mount path of CephFS
    Path = "/";
    FSAL {
        name = CEPH;
        # hostname or IP address of this Node
        hostname="10.0.0.51";
    }
    # setting for root Squash
    Squash="No_root_squash";
    # NFSv4 Pseudo path
    Pseudo="/vfs_ceph";
    # allowed security options
    SecType = "sys";
}
LOG {
    # default log level
    Default_Log_Level = WARN;
}

[root@node01 ~]#
systemctl enable --now nfs-ganesha
[2] If SELinux is enabled, change policy.
[root@dlp ~]#
vi nfs-ganesha.te
# create new

module nfs-ganesha 1.0;

require {
        type cyphesis_port_t;
        type ganesha_t;
        class tcp_socket name_connect;
}

#============= ganesha_t ==============
allow ganesha_t cyphesis_port_t:tcp_socket name_connect;

[root@dlp ~]#
checkmodule -m -M -o nfs-ganesha.mod nfs-ganesha.te

[root@dlp ~]#
semodule_package --outfile nfs-ganesha.pp --module nfs-ganesha.mod

[root@dlp ~]#
semodule -i nfs-ganesha.pp

[3] If Firewalld is running, allow NFS service.
[root@node01 ~]#
firewall-cmd --add-service=nfs --permanent

success
[root@node01 ~]#
firewall-cmd --reload

success
[4] Verify NFS mounting on a Client Host.
[root@client ~]#
dnf -y install nfs-utils
# specify Pseudo path set on [Pseudo=***] in ganesha.conf

[root@client ~]#
mount -t nfs4 node01.srv.world:/vfs_ceph /mnt

[root@client ~]#
df -hT

Filesystem                 Type      Size  Used Avail Use% Mounted on
devtmpfs                   devtmpfs  3.8G     0  3.8G   0% /dev
tmpfs                      tmpfs     3.9G     0  3.9G   0% /dev/shm
tmpfs                      tmpfs     3.9G  8.6M  3.9G   1% /run
tmpfs                      tmpfs     3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/mapper/cl-root        xfs        26G  2.0G   25G   8% /
/dev/vda1                  ext4      976M  259M  651M  29% /boot
tmpfs                      tmpfs     781M     0  781M   0% /run/user/0
node01.srv.world:/vfs_ceph nfs4       75G     0   75G   0% /mnt
Matched Content