2020-02-25 14:21:06 +00:00
|
|
|
=======================
|
|
|
|
CephFS Exports over NFS
|
|
|
|
=======================
|
|
|
|
|
|
|
|
CephFS namespaces can be exported over NFS protocol using the
|
|
|
|
`NFS-Ganesha NFS server <https://github.com/nfs-ganesha/nfs-ganesha/wiki>`_.
|
|
|
|
|
|
|
|
Requirements
|
|
|
|
============
|
|
|
|
|
2020-07-10 11:25:41 +00:00
|
|
|
- Latest Ceph file system with mgr enabled
|
|
|
|
- 'nfs-ganesha', 'nfs-ganesha-ceph', 'nfs-ganesha-rados-grace' and
|
|
|
|
'nfs-ganesha-rados-urls' packages (version 3.3 and above)
|
2020-02-25 14:21:06 +00:00
|
|
|
|
|
|
|
Create NFS Ganesha Cluster
|
|
|
|
==========================
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
2020-07-15 19:14:25 +00:00
|
|
|
$ ceph nfs cluster create <type> <clusterid> [<placement>]
|
2020-02-25 14:21:06 +00:00
|
|
|
|
2020-09-08 06:30:48 +00:00
|
|
|
This creates a common recovery pool for all NFS Ganesha daemons, new user based on
|
2020-09-08 08:23:08 +00:00
|
|
|
cluster_id, and a common NFS Ganesha config RADOS object.
|
|
|
|
|
|
|
|
NOTE: Since this command also brings up NFS Ganesha daemons using a ceph-mgr
|
|
|
|
orchestrator module (see :doc:`/mgr/orchestrator`) such as "mgr/cephadm", at
|
|
|
|
least one such module must be enabled for it to work.
|
2020-02-25 14:21:06 +00:00
|
|
|
|
2020-07-15 19:14:25 +00:00
|
|
|
<type> signifies the export type, which corresponds to the NFS Ganesha file
|
|
|
|
system abstraction layer (FSAL). Permissible values are "cephfs" or "rgw", but
|
|
|
|
currently only "cephfs" is supported.
|
|
|
|
|
|
|
|
<clusterid> is an arbitrary string by which this NFS Ganesha cluster will be
|
|
|
|
known.
|
|
|
|
|
|
|
|
<placement> is an optional string signifying which hosts should have NFS Ganesha
|
|
|
|
daemon containers running on them and, optionally, the total number of NFS
|
|
|
|
Ganesha daemons the cluster (should you want to have more than one NFS Ganesha
|
|
|
|
daemon running per node). For example, the following placement string means
|
|
|
|
"deploy NFS Ganesha daemons on nodes host1 and host2 (one daemon per host):
|
|
|
|
|
|
|
|
"host1,host2"
|
|
|
|
|
|
|
|
and this placement specification says to deploy two NFS Ganesha daemons each
|
|
|
|
on nodes host1 and host2 (for a total of four NFS Ganesha daemons in the
|
|
|
|
cluster):
|
|
|
|
|
|
|
|
"4 host1,host2"
|
|
|
|
|
|
|
|
For more details on placement specification refer to the `orchestrator doc
|
|
|
|
<https://docs.ceph.com/docs/master/mgr/orchestrator/#placement-specification>`_
|
|
|
|
but keep in mind that specifying the placement via a YAML file is not supported.
|
2020-02-25 14:21:06 +00:00
|
|
|
|
2020-04-23 13:40:48 +00:00
|
|
|
Update NFS Ganesha Cluster
|
|
|
|
==========================
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
$ ceph nfs cluster update <clusterid> <placement>
|
|
|
|
|
|
|
|
This updates the deployed cluster according to the placement value.
|
|
|
|
|
2020-04-23 15:46:16 +00:00
|
|
|
Delete NFS Ganesha Cluster
|
|
|
|
==========================
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
$ ceph nfs cluster delete <clusterid>
|
|
|
|
|
|
|
|
This deletes the deployed cluster.
|
|
|
|
|
2020-06-11 05:18:56 +00:00
|
|
|
List NFS Ganesha Cluster
|
|
|
|
========================
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
$ ceph nfs cluster ls
|
|
|
|
|
|
|
|
This lists deployed clusters.
|
|
|
|
|
2020-06-22 18:38:28 +00:00
|
|
|
Show NFS Ganesha Cluster Information
|
|
|
|
====================================
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
$ ceph nfs cluster info [<clusterid>]
|
|
|
|
|
|
|
|
This displays ip and port of deployed cluster.
|
|
|
|
|
2020-09-08 06:30:48 +00:00
|
|
|
Set Customized NFS Ganesha Configuration
|
|
|
|
========================================
|
2020-07-29 13:48:06 +00:00
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
$ ceph nfs cluster config set <clusterid> -i <config_file>
|
|
|
|
|
|
|
|
With this the nfs cluster will use the specified config and it will have
|
|
|
|
precedence over default config blocks.
|
|
|
|
|
2020-09-08 06:30:48 +00:00
|
|
|
Reset NFS Ganesha Configuration
|
|
|
|
===============================
|
2020-07-29 13:48:06 +00:00
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
$ ceph nfs cluster config reset <clusterid>
|
|
|
|
|
|
|
|
This removes the user defined configuration.
|
|
|
|
|
2020-02-25 14:21:06 +00:00
|
|
|
Create CephFS Export
|
|
|
|
====================
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
2020-05-15 17:56:13 +00:00
|
|
|
$ ceph nfs export create cephfs <fsname> <clusterid> <binding> [--readonly] [--path=/path/in/cephfs]
|
2020-02-25 14:21:06 +00:00
|
|
|
|
2020-09-08 06:32:50 +00:00
|
|
|
This creates export RADOS objects containing the export block.
|
2020-07-16 12:26:05 +00:00
|
|
|
|
|
|
|
<fsname> is the name of the FS volume used by the NFS Ganesha cluster that will
|
|
|
|
serve this export.
|
|
|
|
|
|
|
|
<clusterid> is the NFS Ganesha cluster ID.
|
|
|
|
|
|
|
|
<binding> is the pseudo root path (must be an absolute path).
|
2020-02-25 14:21:06 +00:00
|
|
|
|
2020-04-28 16:27:20 +00:00
|
|
|
Delete CephFS Export
|
|
|
|
====================
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
2020-05-14 16:00:46 +00:00
|
|
|
$ ceph nfs export delete <clusterid> <binding>
|
2020-04-28 16:27:20 +00:00
|
|
|
|
2020-07-16 12:26:05 +00:00
|
|
|
It deletes an export in an NFS Ganesha cluster.
|
|
|
|
|
|
|
|
<clusterid> is the NFS Ganesha cluster ID.
|
|
|
|
|
|
|
|
<binding> is the pseudo root path (must be an absolute path).
|
2020-04-28 16:27:20 +00:00
|
|
|
|
2020-06-16 10:29:19 +00:00
|
|
|
List CephFS Export
|
|
|
|
==================
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
$ ceph nfs export ls <clusterid> [--detailed]
|
|
|
|
|
|
|
|
It lists export for a cluster. With detailed option enabled it shows entire
|
|
|
|
export block.
|
|
|
|
|
|
|
|
Get CephFS Export
|
|
|
|
=================
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
$ ceph nfs export get <clusterid> <binding>
|
|
|
|
|
|
|
|
It displays export block for a cluster based on pseudo root name (binding).
|
|
|
|
|
2020-09-08 06:30:48 +00:00
|
|
|
Configuring NFS Ganesha to export CephFS with vstart
|
2020-02-25 14:21:06 +00:00
|
|
|
====================================================
|
|
|
|
|
2020-07-16 11:36:11 +00:00
|
|
|
1) Using cephadm
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
$ MDS=1 MON=1 OSD=3 NFS=1 ../src/vstart.sh -n -d --cephadm
|
|
|
|
|
2020-09-08 06:30:48 +00:00
|
|
|
It can deploy only single NFS Ganesha daemon with vstart on default NFS Ganesha port.
|
2020-07-16 11:36:11 +00:00
|
|
|
|
|
|
|
2) Using test orchestrator
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
$ MDS=1 MON=1 OSD=3 NFS=1 ../src/vstart.sh -n -d
|
2020-02-25 14:21:06 +00:00
|
|
|
|
2020-09-08 06:30:48 +00:00
|
|
|
It can deploy multiple NFS Ganesha daemons on random port. But this requires
|
|
|
|
NFS Ganesha packages to be installed.
|
2020-02-25 14:21:06 +00:00
|
|
|
|
2020-09-08 06:30:48 +00:00
|
|
|
NFS: It is the number of NFS Ganesha clusters to be created.
|
2020-02-25 14:21:06 +00:00
|
|
|
|
|
|
|
Mount
|
|
|
|
=====
|
|
|
|
|
2020-09-08 06:30:48 +00:00
|
|
|
After the exports are successfully created and NFS Ganesha daemons are no longer in
|
2020-02-25 14:21:06 +00:00
|
|
|
grace period. The exports can be mounted by
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
$ mount -t nfs -o port=<ganesha-port> <ganesha-host-name>:<ganesha-pseudo-path> <mount-point>
|
|
|
|
|
|
|
|
.. note:: Only NFS v4.0+ is supported.
|