]> git.proxmox.com Git - ceph.git/blob - ceph/doc/rados/operations/change-mon-elections.rst
558e7d85b78fa7bca8c3248bf4712797445ddc84
[ceph.git] / ceph / doc / rados / operations / change-mon-elections.rst
1 .. _changing_monitor_elections:
2
3 =====================================
4 Configure Monitor Election Strategies
5 =====================================
6
7 By default, the monitors will use the ``classic`` mode. We
8 recommend that you stay in this mode unless you have a very specific reason.
9
10 If you want to switch modes BEFORE constructing the cluster, change
11 the ``mon election default strategy`` option. This option is an integer value:
12
13 * 1 for "classic"
14 * 2 for "disallow"
15 * 3 for "connectivity"
16
17 Once your cluster is running, you can change strategies by running ::
18
19 $ ceph mon set election_strategy {classic|disallow|connectivity}
20
21 Choosing a mode
22 ===============
23 The modes other than classic provide different features. We recommend
24 you stay in classic mode if you don't need the extra features as it is
25 the simplest mode.
26
27 The disallow Mode
28 =================
29 This mode lets you mark monitors as disallowd, in which case they will
30 participate in the quorum and serve clients, but cannot be elected leader. You
31 may wish to use this if you have some monitors which are known to be far away
32 from clients.
33 You can disallow a leader by running ::
34
35 $ ceph mon add disallowed_leader {name}
36
37 You can remove a monitor from the disallowed list, and allow it to become
38 a leader again, by running ::
39
40 $ ceph mon rm disallowed_leader {name}
41
42 The list of disallowed_leaders is included when you run ::
43
44 $ ceph mon dump
45
46 The connectivity Mode
47 =====================
48 This mode evaluates connection scores provided by each monitor for its
49 peers and elects the monitor with the highest score. This mode is designed
50 to handle network partitioning or *net-splits*, which may happen if your cluster
51 is stretched across multiple data centers or otherwise has a non-uniform
52 or unbalanced network topology.
53
54 This mode also supports disallowing monitors from being the leader
55 using the same commands as above in disallow.
56
57 Examining connectivity scores
58 =============================
59 The monitors maintain connection scores even if they aren't in
60 the connectivity election mode. You can examine the scores a monitor
61 has by running ::
62
63 ceph daemon mon.{name} connection scores dump
64
65 Scores for individual connections range from 0-1 inclusive, and also
66 include whether the connection is considered alive or dead (determined by
67 whether it returned its latest ping within the timeout).
68
69 While this would be an unexpected occurrence, if for some reason you experience
70 problems and troubleshooting makes you think your scores have become invalid,
71 you can forget history and reset them by running ::
72
73 ceph daemon mon.{name} connection scores reset
74
75 While resetting scores has low risk (monitors will still quickly determine
76 if a connection is alive or dead, and trend back to the previous scores if they
77 were accurate!), it should also not be needed and is not recommended unless
78 requested by your support team or a developer.