Ceph Squid : CephFS + NFS-Ganesha2024/10/25 |
Install NFS-Ganesha to mount Ceph File System with NFS protocol.
For example, Configure NFS Export setting to CephFS like here.
|
|
[1] | Install and Configure NFS-Ganesha on CephFS Node. |
[root@node01 ~]#
dnf -y install centos-release-nfs-ganesha6
[root@node01 ~]#
sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-NFS-Ganesha-6.repo
[root@node01 ~]#
[root@node01 ~]# dnf --enablerepo=centos-nfs-ganesha-6 -y install nfs-ganesha-ceph 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 { # unique 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; } systemctl enable --now nfs-ganesha.service
|
[2] | If SELinux is enabled, change policy. |
[root@node01 ~]#
vi nfs-ganesha.te # create new module nfs-ganesha 1.0; require { type cyphesis_port_t; type unreserved_port_t; type ganesha_t; class capability sys_resource; class tcp_socket { name_connect name_bind }; } #============= ganesha_t ============== allow ganesha_t cyphesis_port_t:tcp_socket name_connect; allow ganesha_t unreserved_port_t:tcp_socket name_bind; allow ganesha_t self:capability sys_resource; checkmodule -m -M -o nfs-ganesha.mod nfs-ganesha.te [root@node01 ~]# semodule_package --outfile nfs-ganesha.pp --module nfs-ganesha.mod [root@node01 ~]# semodule -i nfs-ganesha.pp |
[3] | If Firewalld is running, allow NFS service. |
[root@node01 ~]# firewall-cmd --add-service=nfs success [root@node01 ~]# firewall-cmd --runtime-to-permanent 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 4.0M 0 4.0M 0% /dev tmpfs tmpfs 1.8G 0 1.8G 0% /dev/shm tmpfs tmpfs 731M 8.6M 723M 2% /run /dev/mapper/cs-root xfs 26G 2.6G 24G 10% / /dev/vda1 xfs 1014M 313M 702M 31% /boot tmpfs tmpfs 366M 0 366M 0% /run/user/0 node01.srv.world:/vfs_ceph nfs4 152G 0 152G 0% /mnt |
Sponsored Link |