From 7178f1caa8cf7c6f65f8d72a28718da417426af8 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 5 Dec 2011 14:07:44 -0800 Subject: [PATCH] doc: document monitor cluster expansion/contraction Pretty sure my rst syntax is wrong. Signed-off-by: Sage Weil --- doc/ops/manage/grow/mon.rst | 75 ++++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/doc/ops/manage/grow/mon.rst b/doc/ops/manage/grow/mon.rst index eee28004ec0de..15b5df09a3cd4 100644 --- a/doc/ops/manage/grow/mon.rst +++ b/doc/ops/manage/grow/mon.rst @@ -2,4 +2,77 @@ Resizing the monitor cluster ============================== -.. todo:: Choosing and adjusting cluster size +Adding a monitor +---------------- + +1) Initialize the new monitor's data directory with the ``ceph-mon +--mkfs`` command. You need to provide the new monitor with three +pieces of information: + + - the cluster fsid + - one or more existing monitors to join + - the monitor authentication key ``mon.`` + + The simplest way to do this is probably:: + + $ ceph mon getmap -o /tmp/monmap + $ ceph auth export mon. -o /tmp/monkey + $ ceph-mon -i newname --mkfs --monmap /tmp/foo --keyring /tmp/monkey + +2) Start the new monitor and it will automatically join the cluster:: + + $ ceph-mon -i newname + +3) If you would like other nodes to be able to use this monitor during +their initial startup, you'll need to adjust ``ceph.conf`` to add a +section and ``mon addr`` for the new monitor, or add it to the +existing ``mon host`` list. + + +Removing a monitor from a healthy cluster +----------------------------------------- + +If the cluster is healthy, you can do:: + + $ ceph mon remove $id + +For example, if your cluster includes ``mon.a``, ``mon.b``, and ``mon.c``, then you can remove ``mon.c`` with:: + + $ ceph mon remove c + +Removing a monitor from an unhealth/down cluster +------------------------------------------------ + +The mon cluster may not be up because you have lost too many nodes to +form a quorum. + +1) On a surviving monitor node, find the most recent monmap:: + + $ ls $mon_data/monmap + 1 2 accepted_pn last_committed latest + + in this case it is 2. + +2) Copy to a temporary location and modify the monmap to remove the +node(s) you don't want. Let's say the map has ``mon.a``, ``mon.b``, +and ``mon.c``, but only ``mon.a`` is surviving:: + + $ cp $mon_data/monmap/2 /tmp/foo + $ monmaptool /tmp/foo --rm b + $ monmaptool /tmp/foo --rm c + +3) Make sure ceph-mon isn't running:: + + $ service ceph stop mon + +4) Inject the modified map on any surviving nodes. For example, for +``mon.a``:: + + $ ceph-mon -i a --inject-monmap /tmp/foo # for each surviving monitor + +5) Start the surviving monitor(s):: + + $ service ceph start mon # on each node with a surviving monitor + +6) Remove the old monitors from ``ceph.conf`` so that nobody tries to +connect to the old instances. \ No newline at end of file -- 2.39.5