3.3.3 Exporting Ceph FS Over NFS

Ceph FS namespaces can be exported over NFS using NFS-Ganesha, a user space file server with support for the NFS protocol. More information on using NFS-Ganesha to export Ceph FS over NFS is available in the upstream documentation at:

http://docs.ceph.com/docs/master/cephfs/nfs/

To set up the NFS server:

  1. Make sure the NFS server host is connected to the Ceph public network and part of the Ceph Storage Cluster.

  2. Install the libcephfs2, nfs-ganesha and nfs-ganesha-ceph packages:

    # yum install libcephfs2 nfs-ganesha nfs-ganesha-ceph
  3. Edit the /etc/ganesha/ganesha.conf file to suit your requirements, for example:

    EXPORT 
    { 
    # Export Id (mandatory, each EXPORT must have a unique Export_Id) 
    Export_Id = 1; 
    
    # Use NFSv4
    Protocols = 4;
    
    # NFSv4 does not allow UDP transport
    Transports = TCP;
    
    # Path into the cephfs tree. For now, FSAL_CEPH doesn't support
    # having more than one file system per running ganesha daemon.
    #
    # Note that FSAL_CEPH does not support subtree checking, so there is
    # no way to validate that a filehandle presented by a client is
    # reachable via an exported subtree.
    #
    # For that reason, we just export "/" here.
    Path = /; 
    
    # Pseudo Path (required for NFS v4) 
    # The pseudoroot path. This is where the export will appear in the
    # NFS pseudoroot namespace.
    Pseudo = /mnt/cephfs; 
    
    # Required for access (default is None) 
    # Could use CLIENT blocks instead 
    Access_Type = RW; 
         Squash = no_root_squash; 
    SecType = sys; 
    
    # Exporting FSAL 
    FSAL { 
      Name = CEPH; 
      } 
    } 
  4. Restart the nfs-ganesha service:

    # systemctl restart nfs-ganesha.service
  5. Mount the Ceph file system. See Section 3.3.2, “Mounting Ceph FS” for information on mounting a Ceph file system.