summaryrefslogtreecommitdiffstats
path: root/doc/rados/operations/change-mon-elections.rst
blob: eba730bdccae4be82d977cd4bacfec718fd5a2b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
.. _changing_monitor_elections:

=====================================
Configure Monitor Election Strategies
=====================================

By default, the monitors will use the ``classic`` mode. We
recommend that you stay in this mode unless you have a very specific reason.

If you want to switch modes BEFORE constructing the cluster, change
the ``mon election default strategy`` option. This option is an integer value:

* 1 for "classic"
* 2 for "disallow"
* 3 for "connectivity"

Once your cluster is running, you can change strategies by running ::

  $ ceph mon set election_strategy {classic|disallow|connectivity}

Choosing a mode
===============
The modes other than classic provide different features. We recommend
you stay in classic mode if you don't need the extra features as it is
the simplest mode.

The disallow Mode
=================
This mode lets you mark monitors as disallowd, in which case they will
participate in the quorum and serve clients, but cannot be elected leader. You
may wish to use this if you have some monitors which are known to be far away
from clients.
You can disallow a leader by running:

.. prompt:: bash $

   ceph mon add disallowed_leader {name}

You can remove a monitor from the disallowed list, and allow it to become
a leader again, by running:

.. prompt:: bash $

   ceph mon rm disallowed_leader {name}

The list of disallowed_leaders is included when you run:

.. prompt:: bash $

   ceph mon dump

The connectivity Mode
=====================
This mode evaluates connection scores provided by each monitor for its
peers and elects the monitor with the highest score. This mode is designed
to handle network partitioning or *net-splits*, which may happen if your cluster
is stretched across multiple data centers or otherwise has a non-uniform
or unbalanced network topology.

This mode also supports disallowing monitors from being the leader
using the same commands as above in disallow.

Examining connectivity scores
=============================
The monitors maintain connection scores even if they aren't in
the connectivity election mode. You can examine the scores a monitor
has by running:

.. prompt:: bash $

   ceph daemon mon.{name} connection scores dump

Scores for individual connections range from 0-1 inclusive, and also
include whether the connection is considered alive or dead (determined by
whether it returned its latest ping within the timeout).

While this would be an unexpected occurrence, if for some reason you experience
problems and troubleshooting makes you think your scores have become invalid,
you can forget history and reset them by running:

.. prompt:: bash $

   ceph daemon mon.{name} connection scores reset

While resetting scores has low risk (monitors will still quickly determine
if a connection is alive or dead, and trend back to the previous scores if they
were accurate!), it should also not be needed and is not recommended unless
requested by your support team or a developer.