]> git.proxmox.com Git - ceph.git/blame - ceph/doc/cephfs/nfs.rst
update ceph source to reef 18.1.2
[ceph.git] / ceph / doc / cephfs / nfs.rst
CommitLineData
a4b75251
TL
1.. _cephfs-nfs:
2
11fdf7f2
TL
3===
4NFS
5===
6
20effc67
TL
7CephFS namespaces can be exported over NFS protocol using the `NFS-Ganesha NFS
8server`_. This document provides information on configuring NFS-Ganesha
a4b75251
TL
9clusters manually. The simplest and preferred way of managing NFS-Ganesha
10clusters and CephFS exports is using ``ceph nfs ...`` commands. See
11:doc:`/mgr/nfs` for more details. As the deployment is done using cephadm or
12rook.
11fdf7f2
TL
13
14Requirements
15============
16
20effc67
TL
17- Ceph file system
18- ``libcephfs2``, ``nfs-ganesha`` and ``nfs-ganesha-ceph`` packages on NFS
19 server host machine.
11fdf7f2
TL
20- NFS-Ganesha server host connected to the Ceph public network
21
a4b75251
TL
22.. note::
23 It is recommended to use 3.5 or later stable version of NFS-Ganesha
24 packages with pacific (16.2.x) or later stable version of Ceph packages.
25
11fdf7f2
TL
26Configuring NFS-Ganesha to export CephFS
27========================================
28
20effc67
TL
29NFS-Ganesha provides a File System Abstraction Layer (FSAL) to plug in
30different storage backends. FSAL_CEPH_ is the plugin FSAL for CephFS. For
31each NFS-Ganesha export, FSAL_CEPH_ uses a libcephfs client to mount the
32CephFS path that NFS-Ganesha exports.
11fdf7f2 33
20effc67
TL
34Setting up NFS-Ganesha with CephFS, involves setting up NFS-Ganesha's and
35Ceph's configuration file and CephX access credentials for the Ceph clients
36created by NFS-Ganesha to access CephFS.
11fdf7f2
TL
37
38NFS-Ganesha configuration
39-------------------------
40
20effc67
TL
41Here's a `sample ganesha.conf`_ configured with FSAL_CEPH_. It is suitable
42for a standalone NFS-Ganesha server, or an active/passive configuration of
43NFS-Ganesha servers, to be managed by some sort of clustering software
44(e.g., Pacemaker). Important details about the options are added as comments
45in the sample conf. There are options to do the following:
11fdf7f2
TL
46
47- minimize Ganesha caching wherever possible since the libcephfs clients
20effc67 48 (of FSAL_CEPH_) also cache aggressively
11fdf7f2
TL
49
50- read from Ganesha config files stored in RADOS objects
51
52- store client recovery data in RADOS OMAP key-value interface
53
54- mandate NFSv4.1+ access
55
20effc67
TL
56- enable read delegations (need at least v13.0.1 ``libcephfs2`` package
57 and v2.6.0 stable ``nfs-ganesha`` and ``nfs-ganesha-ceph`` packages)
11fdf7f2 58
1e59de90
TL
59.. important::
60
61 Under certain conditions, NFS access using the CephFS FSAL fails. This
62 causes an error to be thrown that reads "Input/output error". Under these
63 circumstances, the application metadata must be set for the CephFS metadata
64 and CephFS data pools. Do this by running the following command:
65
66 .. prompt:: bash $
67
68 ceph osd pool application set <cephfs_metadata_pool> cephfs <cephfs_data_pool> cephfs
69
70
11fdf7f2
TL
71Configuration for libcephfs clients
72-----------------------------------
73
20effc67
TL
74``ceph.conf`` for libcephfs clients includes a ``[client]`` section with
75``mon_host`` option set to let the clients connect to the Ceph cluster's
76monitors, usually generated via ``ceph config generate-minimal-conf``.
77For example::
11fdf7f2 78
20effc67 79 [client]
9f95a23c 80 mon host = [v2:192.168.1.7:3300,v1:192.168.1.7:6789], [v2:192.168.1.8:3300,v1:192.168.1.8:6789], [v2:192.168.1.9:3300,v1:192.168.1.9:6789]
11fdf7f2
TL
81
82Mount using NFSv4 clients
83=========================
84
85It is preferred to mount the NFS-Ganesha exports using NFSv4.1+ protocols
86to get the benefit of sessions.
87
88Conventions for mounting NFS resources are platform-specific. The
89following conventions work on Linux and some Unix platforms:
90
a4b75251 91.. code:: bash
11fdf7f2 92
a4b75251 93 mount -t nfs -o nfsvers=4.1,proto=tcp <ganesha-host-name>:<ganesha-pseudo-path> <mount-point>
11fdf7f2 94
11fdf7f2 95
20effc67
TL
96.. _FSAL_CEPH: https://github.com/nfs-ganesha/nfs-ganesha/tree/next/src/FSAL/FSAL_CEPH
97.. _NFS-Ganesha NFS server: https://github.com/nfs-ganesha/nfs-ganesha/wiki
98.. _sample ganesha.conf: https://github.com/nfs-ganesha/nfs-ganesha/blob/next/src/config_samples/ceph.conf