]> git.proxmox.com Git - ceph.git/blob - ceph/doc/cephfs/fs-nfs-exports.rst
9740404bd6022a47322012b28210a10f23029f1d
[ceph.git] / ceph / doc / cephfs / fs-nfs-exports.rst
1 =======================
2 CephFS Exports over NFS
3 =======================
4
5 CephFS namespaces can be exported over NFS protocol using the
6 `NFS-Ganesha NFS server <https://github.com/nfs-ganesha/nfs-ganesha/wiki>`_.
7
8 Requirements
9 ============
10
11 - Latest Ceph file system with mgr enabled
12 - 'nfs-ganesha', 'nfs-ganesha-ceph', 'nfs-ganesha-rados-grace' and
13 'nfs-ganesha-rados-urls' packages (version 3.3 and above)
14
15 Create NFS Ganesha Cluster
16 ==========================
17
18 .. code:: bash
19
20 $ ceph nfs cluster create <type=cephfs> <clusterid> [<placement>]
21
22 This creates a common recovery pool for all Ganesha daemons, new user based on
23 cluster_id and common ganesha config rados object.
24
25 Here type is export type and placement specifies the size of cluster and hosts.
26 For more details on placement specification refer the `orchestrator doc
27 <https://docs.ceph.com/docs/master/mgr/orchestrator/#placement-specification>`_.
28 Currently only CephFS export type is supported.
29
30 Update NFS Ganesha Cluster
31 ==========================
32
33 .. code:: bash
34
35 $ ceph nfs cluster update <clusterid> <placement>
36
37 This updates the deployed cluster according to the placement value.
38
39 Delete NFS Ganesha Cluster
40 ==========================
41
42 .. code:: bash
43
44 $ ceph nfs cluster delete <clusterid>
45
46 This deletes the deployed cluster.
47
48 List NFS Ganesha Cluster
49 ========================
50
51 .. code:: bash
52
53 $ ceph nfs cluster ls
54
55 This lists deployed clusters.
56
57 Show NFS Ganesha Cluster Information
58 ====================================
59
60 .. code:: bash
61
62 $ ceph nfs cluster info [<clusterid>]
63
64 This displays ip and port of deployed cluster.
65
66 Set Customized Ganesha Configuration
67 ====================================
68
69 .. code:: bash
70
71 $ ceph nfs cluster config set <clusterid> -i <config_file>
72
73 With this the nfs cluster will use the specified config and it will have
74 precedence over default config blocks.
75
76 Reset Ganesha Configuration
77 ===========================
78
79 .. code:: bash
80
81 $ ceph nfs cluster config reset <clusterid>
82
83 This removes the user defined configuration.
84
85 Create CephFS Export
86 ====================
87
88 .. code:: bash
89
90 $ ceph nfs export create cephfs <fsname> <clusterid> <binding> [--readonly] [--path=/path/in/cephfs]
91
92 It creates export rados objects containing the export block. Here binding is
93 the pseudo root name and type is export type.
94
95 Delete CephFS Export
96 ====================
97
98 .. code:: bash
99
100 $ ceph nfs export delete <clusterid> <binding>
101
102 It deletes an export in cluster based on pseudo root name (binding).
103
104 List CephFS Export
105 ==================
106
107 .. code:: bash
108
109 $ ceph nfs export ls <clusterid> [--detailed]
110
111 It lists export for a cluster. With detailed option enabled it shows entire
112 export block.
113
114 Get CephFS Export
115 =================
116
117 .. code:: bash
118
119 $ ceph nfs export get <clusterid> <binding>
120
121 It displays export block for a cluster based on pseudo root name (binding).
122
123 Configuring NFS-Ganesha to export CephFS with vstart
124 ====================================================
125
126 1) Using cephadm
127
128 .. code:: bash
129
130 $ MDS=1 MON=1 OSD=3 NFS=1 ../src/vstart.sh -n -d --cephadm
131
132 It can deploy only single ganesha daemon with vstart on default ganesha port.
133
134 2) Using test orchestrator
135
136 .. code:: bash
137
138 $ MDS=1 MON=1 OSD=3 NFS=1 ../src/vstart.sh -n -d
139
140 It can deploy multiple ganesha daemons on random port. But this requires
141 ganesha packages to be installed.
142
143 NFS: It is the number of NFS-Ganesha clusters to be created.
144
145 Mount
146 =====
147
148 After the exports are successfully created and Ganesha daemons are no longer in
149 grace period. The exports can be mounted by
150
151 .. code:: bash
152
153 $ mount -t nfs -o port=<ganesha-port> <ganesha-host-name>:<ganesha-pseudo-path> <mount-point>
154
155 .. note:: Only NFS v4.0+ is supported.