The Network Filesystem (NFS) is one of the most popular sharable filesystem protocols that can be used with every Unix-based system. Unix-based clients that do not understand the CephFS type can still access the Ceph Filesystem using NFS. To do this, we would require an NFS server in place that can re-export CephFS as an NFS share. NFS-Ganesha is an NFS server that runs in user space and supports the CephFS FSAL (File System Abstraction Layer) using libcephfs
.
In this recipe, we will demonstrate creating ceph-node1
as an NFS-Ganesha server and exporting CephFS as an NFS and mounting it on client-node1
.
ceph-node1
, install packages required for nfs-ganesha
:# yum install -y nfs-utils nfs-ganesha nfs-ganesha-fsal-ceph
2049
:# systemctl stop firewalld; systemctl disable firewalld
rpc
services required by NFS:# systemctl start rpcbind; systemctl enable rpcbind # systemctl start rpc-statd.service
/etc/ganesha.conf
, with the following contents:EXPORT { Export_ID = 1; Path = "/"; Pseudo = "/"; Access_Type = RW; NFS_Protocols = "3"; Squash = No_Root_Squash; Transport_Protocols = TCP; SecType = "none"; FSAL { Name = CEPH; } }
ganesha nfs
daemon by providing the ganesha.conf
file that we created in the last step. You can verify the exported NFS share using the showmount
command:# ganesha.nfsd -f /etc/ganesha.conf -L /var/log/ganesha.log -N NIV_DEBUG -d # showmount -e
Let's recall the steps that we have taken: ceph-node2
has been configured as Ceph MDS, and ceph-node1
has been configured as the NFS-Ganesha server.
Next, in order to mount the NFS share on client machines, we just need to install the NFS client packages and mount the share exported by ceph-node1
, as shown next:
Install the nfs
client packages on client-node1
and mount
:
# apt-get install nfs-common # mkdir /mnt/cephfs # mount -o rw,noatime 192.168.1.101:/ /mnt/cephfs
18.117.76.204