Exporting a GlusterFS volume as an NFS share allows you to share storage across a network using the NFS protocol. In newer versions of GlusterFS, the built-in NFS server (Gluster-NFS) is deprecated, so the recommended method is to use NFS-Ganesha. This enables the distributed storage benefits of GlusterFS to be accessed using the widely supported NFS protocol.
Configuring NFS-Ganesha to export a GlusterFS volume involves installing and configuring the NFS-Ganesha service on the nodes where the GlusterFS volume resides. This method provides a scalable, redundant, and highly available storage solution that is accessible over NFS. Proper configuration of both the volume and network is critical for ensuring smooth operation.
Once the volume is exported via NFS-Ganesha, clients can mount and access the shared volume. Network configurations such as firewalls must be set up to allow NFS traffic between clients and the GlusterFS nodes. This allows for easy integration with systems that natively support NFS.
Steps to export GlusterFS volume as NFS share:
- Install the NFS-Ganesha service.
$ sudo apt install nfs-ganesha # Ubuntu/Debian$ sudo yum install nfs-ganesha # CentOS/Fedora/Red Hat
- Start and enable the NFS-Ganesha service.
$ sudo systemctl start nfs-ganesha $ sudo systemctl enable nfs-ganesha
- Add the GlusterFS volume export to the NFS-Ganesha configuration.
$ sudo nano /etc/ganesha/ganesha.conf EXPORT { Export_Id = 1; Path = "/var/glusterfs/volume1"; Pseudo = "/volume1"; Access_Type = RW; Squash = No_Root_Squash; FSAL { Name = GLUSTER; hostname = "node1"; Volume = "volume1"; } }
- Restart the NFS-Ganesha service to apply changes.
$ sudo systemctl restart nfs-ganesha
- Allow NFS traffic through the firewall.
$ sudo firewall-cmd --zone=public --add-service=nfs --permanent && sudo firewall-cmd --reload # CentOS, Fedora, Red Hat $ sudo ufw allow nfs # Ubuntu and Debian
- On the client, mount the exported GlusterFS volume as an NFS share.
$ sudo mount -t nfs server_ip:/volume1 /mnt
- Verify the mount by listing the contents of the mounted directory.
$ ls /mnt

Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
Comment anonymously. Login not required.