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