]> git.proxmox.com Git - ceph.git/blame - ceph/doc/cephfs/add-remove-mds.rst
import ceph quincy 17.2.1
[ceph.git] / ceph / doc / cephfs / add-remove-mds.rst
CommitLineData
33c7a0ef
TL
1.. note::
2 It is highly recommended to use :doc:`/cephadm/index` or another Ceph
3 orchestrator for setting up the ceph cluster. Use this approach only if you
4 are setting up the ceph cluster manually. If one still intends to use the
5 manual way for deploying MDS daemons, :doc:`/cephadm/services/mds/` can
6 also be used.
7
11fdf7f2 8============================
92f5a8d4 9 Deploying Metadata Servers
11fdf7f2
TL
10============================
11
92f5a8d4
TL
12Each CephFS file system requires at least one MDS. The cluster operator will
13generally use their automated deployment tool to launch required MDS servers as
14needed. Rook and ansible (via the ceph-ansible playbooks) are recommended
15tools for doing this. For clarity, we also show the systemd commands here which
16may be run by the deployment technology if executed on bare-metal.
11fdf7f2
TL
17
18See `MDS Config Reference`_ for details on configuring metadata servers.
19
20
92f5a8d4
TL
21Provisioning Hardware for an MDS
22================================
11fdf7f2 23
92f5a8d4 24The present version of the MDS is single-threaded and CPU-bound for most
9f95a23c
TL
25activities, including responding to client requests. An MDS under the most
26aggressive client loads uses about 2 to 3 CPU cores. This is due to the other
27miscellaneous upkeep threads working in tandem.
92f5a8d4
TL
28
29Even so, it is recommended that an MDS server be well provisioned with an
30advanced CPU with sufficient cores. Development is on-going to make better use
31of available CPU cores in the MDS; it is expected in future versions of Ceph
32that the MDS server will improve performance by taking advantage of more cores.
33
34The other dimension to MDS performance is the available RAM for caching. The
35MDS necessarily manages a distributed and cooperative metadata cache among all
36clients and other active MDSs. Therefore it is essential to provide the MDS
9f95a23c 37with sufficient RAM to enable faster metadata access and mutation. The default
adb31ebb 38MDS cache size (see also :doc:`/cephfs/cache-configuration`) is 4GB. It is
9f95a23c
TL
39recommended to provision at least 8GB of RAM for the MDS to support this cache
40size.
92f5a8d4
TL
41
42Generally, an MDS serving a large cluster of clients (1000 or more) will use at
9f95a23c
TL
43least 64GB of cache. An MDS with a larger cache is not well explored in the
44largest known community clusters; there may be diminishing returns where
45management of such a large cache negatively impacts performance in surprising
46ways. It would be best to do analysis with expected workloads to determine if
47provisioning more RAM is worthwhile.
92f5a8d4
TL
48
49In a bare-metal cluster, the best practice is to over-provision hardware for
50the MDS server. Even if a single MDS daemon is unable to fully utilize the
51hardware, it may be desirable later on to start more active MDS daemons on the
52same node to fully utilize the available cores and memory. Additionally, it may
53become clear with workloads on the cluster that performance improves with
54multiple active MDS on the same node rather than over-provisioning a single
55MDS.
56
57Finally, be aware that CephFS is a highly-available file system by supporting
58standby MDS (see also :ref:`mds-standby`) for rapid failover. To get a real
59benefit from deploying standbys, it is usually necessary to distribute MDS
60daemons across at least two nodes in the cluster. Otherwise, a hardware failure
61on a single node may result in the file system becoming unavailable.
62
63Co-locating the MDS with other Ceph daemons (hyperconverged) is an effective
64and recommended way to accomplish this so long as all daemons are configured to
65use available hardware within certain limits. For the MDS, this generally
66means limiting its cache size.
67
68
69Adding an MDS
70=============
71
33c7a0ef 72#. Create an mds directory ``/var/lib/ceph/mds/ceph-${id}``. The daemon only uses this directory to store its keyring.
11fdf7f2 73
9f95a23c 74#. Create the authentication key, if you use CephX: ::
11fdf7f2 75
92f5a8d4 76 $ sudo ceph auth get-or-create mds.${id} mon 'profile mds' mgr 'profile mds' mds 'allow *' osd 'allow *' > /var/lib/ceph/mds/ceph-${id}/keyring
11fdf7f2 77
9f95a23c 78#. Start the service: ::
11fdf7f2 79
9f95a23c 80 $ sudo systemctl start ceph-mds@${id}
11fdf7f2 81
92f5a8d4 82#. The status of the cluster should show: ::
11fdf7f2 83
92f5a8d4 84 mds: ${id}:1 {0=${id}=up:active} 2 up:standby
11fdf7f2 85
9f95a23c
TL
86#. Optionally, configure the file system the MDS should join (:ref:`mds-join-fs`): ::
87
88 $ ceph config set mds.${id} mds_join_fs ${fs}
89
90
92f5a8d4
TL
91Removing an MDS
92===============
11fdf7f2
TL
93
94If you have a metadata server in your cluster that you'd like to remove, you may use
95the following method.
96
92f5a8d4
TL
97#. (Optionally:) Create a new replacement Metadata Server. If there are no
98 replacement MDS to take over once the MDS is removed, the file system will
99 become unavailable to clients. If that is not desirable, consider adding a
100 metadata server before tearing down the metadata server you would like to
101 take offline.
102
103#. Stop the MDS to be removed. ::
104
9f95a23c 105 $ sudo systemctl stop ceph-mds@${id}
11fdf7f2 106
92f5a8d4
TL
107 The MDS will automatically notify the Ceph monitors that it is going down.
108 This enables the monitors to perform instantaneous failover to an available
109 standby, if one exists. It is unnecessary to use administrative commands to
110 effect this failover, e.g. through the use of ``ceph mds fail mds.${id}``.
11fdf7f2 111
92f5a8d4 112#. Remove the ``/var/lib/ceph/mds/ceph-${id}`` directory on the MDS. ::
11fdf7f2 113
92f5a8d4 114 $ sudo rm -rf /var/lib/ceph/mds/ceph-${id}
11fdf7f2
TL
115
116.. _MDS Config Reference: ../mds-config-ref