4
0

votequorum.5 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. .\"/*
  2. .\" * Copyright (c) 2012-2014 Red Hat, Inc.
  3. .\" *
  4. .\" * All rights reserved.
  5. .\" *
  6. .\" * Authors: Christine Caulfield <ccaulfie@redhat.com>
  7. .\" * Fabio M. Di Nitto <fdinitto@redhat.com>
  8. .\" *
  9. .\" * This software licensed under BSD license, the text of which follows:
  10. .\" *
  11. .\" * Redistribution and use in source and binary forms, with or without
  12. .\" * modification, are permitted provided that the following conditions are met:
  13. .\" *
  14. .\" * - Redistributions of source code must retain the above copyright notice,
  15. .\" * this list of conditions and the following disclaimer.
  16. .\" * - Redistributions in binary form must reproduce the above copyright notice,
  17. .\" * this list of conditions and the following disclaimer in the documentation
  18. .\" * and/or other materials provided with the distribution.
  19. .\" * - Neither the name of the MontaVista Software, Inc. nor the names of its
  20. .\" * contributors may be used to endorse or promote products derived from this
  21. .\" * software without specific prior written permission.
  22. .\" *
  23. .\" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  24. .\" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  25. .\" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  26. .\" * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  27. .\" * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  28. .\" * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  29. .\" * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  30. .\" * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  31. .\" * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  32. .\" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  33. .\" * THE POSSIBILITY OF SUCH DAMAGE.
  34. .\" */
  35. .TH VOTEQUORUM 5 2018-12-14 "corosync Man Page" "Corosync Cluster Engine Programmer's Manual"
  36. .SH NAME
  37. votequorum \- Votequorum Configuration Overview
  38. .SH OVERVIEW
  39. The votequorum service is part of the corosync project. This service can be optionally loaded
  40. into the nodes of a corosync cluster to avoid split-brain situations.
  41. It does this by having a number of votes assigned to each system in the cluster and ensuring
  42. that only when a majority of the votes are present, cluster operations are allowed to proceed.
  43. The service must be loaded into all nodes or none. If it is loaded into a subset of cluster nodes
  44. the results will be unpredictable.
  45. .PP
  46. The following corosync.conf extract will enable votequorum service within corosync:
  47. .PP
  48. .nf
  49. quorum {
  50. provider: corosync_votequorum
  51. }
  52. .fi
  53. .PP
  54. votequorum reads its configuration from corosync.conf. Some values can be changed at runtime, others
  55. are only read at corosync startup. It is very important that those values are consistent
  56. across all the nodes participating in the cluster or votequorum behavior will be unpredictable.
  57. .PP
  58. votequorum requires an expected_votes value to function, this can be provided in two ways.
  59. The number of expected votes will be automatically calculated when the nodelist { } section is
  60. present in corosync.conf or expected_votes can be specified in the quorum { } section. Lack of
  61. both will disable votequorum. If both are present at the same time,
  62. the quorum.expected_votes value will override the one calculated from the nodelist.
  63. .PP
  64. Example (no nodelist) of an 8 node cluster (each node has 1 vote):
  65. .nf
  66. quorum {
  67. provider: corosync_votequorum
  68. expected_votes: 8
  69. }
  70. .fi
  71. .PP
  72. Example (with nodelist) of a 3 node cluster (each node has 1 vote):
  73. .nf
  74. quorum {
  75. provider: corosync_votequorum
  76. }
  77. nodelist {
  78. node {
  79. ring0_addr: 192.168.1.1
  80. }
  81. node {
  82. ring0_addr: 192.168.1.2
  83. }
  84. node {
  85. ring0_addr: 192.168.1.3
  86. }
  87. }
  88. .fi
  89. .SH SPECIAL FEATURES
  90. .PP
  91. .B two_node: 1
  92. .PP
  93. Enables two node cluster operations (default: 0).
  94. .PP
  95. The "two node cluster" is a use case that requires special consideration.
  96. With a standard two node cluster, each node with a single vote, there
  97. are 2 votes in the cluster. Using the simple majority calculation
  98. (50% of the votes + 1) to calculate quorum, the quorum would be 2.
  99. This means that the both nodes would always have
  100. to be alive for the cluster to be quorate and operate.
  101. .PP
  102. Enabling two_node: 1, quorum is set artificially to 1.
  103. .PP
  104. Example configuration 1:
  105. .nf
  106. quorum {
  107. provider: corosync_votequorum
  108. expected_votes: 2
  109. two_node: 1
  110. }
  111. .fi
  112. .PP
  113. Example configuration 2:
  114. .nf
  115. quorum {
  116. provider: corosync_votequorum
  117. two_node: 1
  118. }
  119. nodelist {
  120. node {
  121. ring0_addr: 192.168.1.1
  122. }
  123. node {
  124. ring0_addr: 192.168.1.2
  125. }
  126. }
  127. .fi
  128. .PP
  129. NOTES: enabling two_node: 1 automatically enables wait_for_all. It is
  130. still possible to override wait_for_all by explicitly setting it to 0.
  131. If more than 2 nodes join the cluster, the two_node option is
  132. automatically disabled.
  133. .PP
  134. .B wait_for_all: 1
  135. .PP
  136. Enables Wait For All (WFA) feature (default: 0).
  137. .PP
  138. The general behaviour of votequorum is to switch a cluster from inquorate to quorate
  139. as soon as possible. For example, in an 8 node cluster, where every node has 1 vote,
  140. expected_votes is set to 8 and quorum is (50% + 1) 5. As soon as 5 (or more) nodes
  141. are visible to each other, the partition of 5 (or more) becomes quorate and can
  142. start operating.
  143. .PP
  144. When WFA is enabled, the cluster will be quorate for the first time
  145. only after all nodes have been visible at least once at the same time.
  146. .PP
  147. This feature has the advantage of avoiding some startup race conditions, with the cost
  148. that all nodes need to be up at the same time at least once before the cluster
  149. can operate.
  150. .PP
  151. A common startup race condition based on the above example is that as soon as 5
  152. nodes become quorate, with the other 3 still offline, the remaining 3 nodes will
  153. be fenced.
  154. .PP
  155. It is very useful when combined with last_man_standing (see below).
  156. .PP
  157. Example configuration:
  158. .nf
  159. quorum {
  160. provider: corosync_votequorum
  161. expected_votes: 8
  162. wait_for_all: 1
  163. }
  164. .fi
  165. .PP
  166. .B last_man_standing: 1
  167. /
  168. .B last_man_standing_window: 10000
  169. .PP
  170. Enables Last Man Standing (LMS) feature (default: 0).
  171. Tunable last_man_standing_window (default: 10 seconds, expressed in ms).
  172. .PP
  173. The general behaviour of votequorum is to set expected_votes and quorum
  174. at startup (unless modified by the user at runtime, see below) and use
  175. those values during the whole lifetime of the cluster.
  176. .PP
  177. Using for example an 8 node cluster where each node has 1 vote, expected_votes
  178. is set to 8 and quorum to 5. This condition allows a total failure of 3
  179. nodes. If a 4th node fails, the cluster becomes inquorate and it will
  180. stop providing services.
  181. .PP
  182. Enabling LMS allows the cluster to dynamically recalculate expected_votes
  183. and quorum under specific circumstances. It is essential to enable
  184. WFA when using LMS in High Availability clusters.
  185. .PP
  186. Using the above 8 node cluster example, with LMS enabled the cluster can retain
  187. quorum and continue operating by losing, in a cascade fashion, up to 6 nodes with
  188. only 2 remaining active.
  189. .PP
  190. Example chain of events:
  191. .nf
  192. 1) cluster is fully operational with 8 nodes.
  193. (expected_votes: 8 quorum: 5)
  194. 2) 3 nodes die, cluster is quorate with 5 nodes.
  195. 3) after last_man_standing_window timer expires,
  196. expected_votes and quorum are recalculated.
  197. (expected_votes: 5 quorum: 3)
  198. 4) at this point, 2 more nodes can die and
  199. cluster will still be quorate with 3.
  200. 5) once again, after last_man_standing_window
  201. timer expires expected_votes and quorum are
  202. recalculated.
  203. (expected_votes: 3 quorum: 2)
  204. 6) at this point, 1 more node can die and
  205. cluster will still be quorate with 2.
  206. 7) one more last_man_standing_window timer
  207. (expected_votes: 2 quorum: 2)
  208. .fi
  209. .PP
  210. NOTES: In order for the cluster to downgrade automatically from 2 nodes
  211. to a 1 node cluster, the auto_tie_breaker feature must also be enabled (see below).
  212. If auto_tie_breaker is not enabled, and one more failure occurs, the
  213. remaining node will not be quorate. LMS does not work with asymmetric voting
  214. schemes, each node must vote 1. LMS is also incompatible with quorum devices,
  215. if last_man_standing is specified in corosync.conf then the quorum device
  216. will be disabled.
  217. .PP
  218. Example configuration 1:
  219. .nf
  220. quorum {
  221. provider: corosync_votequorum
  222. expected_votes: 8
  223. last_man_standing: 1
  224. }
  225. .fi
  226. .PP
  227. Example configuration 2 (increase timeout to 20 seconds):
  228. .nf
  229. quorum {
  230. provider: corosync_votequorum
  231. expected_votes: 8
  232. last_man_standing: 1
  233. last_man_standing_window: 20000
  234. }
  235. .fi
  236. .PP
  237. .B auto_tie_breaker: 1
  238. .PP
  239. Enables Auto Tie Breaker (ATB) feature (default: 0).
  240. .PP
  241. The general behaviour of votequorum allows a simultaneous node failure up
  242. to 50% - 1 node, assuming each node has 1 vote.
  243. .PP
  244. When ATB is enabled, the cluster can suffer up to 50% of the nodes failing
  245. at the same time, in a deterministic fashion. By default the cluster
  246. partition, or the set of nodes that are still in contact with the
  247. node that has the lowest nodeid will remain quorate. The other nodes will
  248. be inquorate. This behaviour can be changed by also specifying
  249. .PP
  250. .B auto_tie_breaker_node: lowest|highest|<list of node IDs>
  251. .PP
  252. \(oqlowest\(cq is the default, \(oqhighest\(cq is similar in that if the current set of
  253. nodes contains the highest nodeid then it will remain quorate. Alternatively
  254. it is possible to specify a particular node ID or list of node IDs that will
  255. be required to maintain quorum. If a (space-separated) list is given, the
  256. nodes are evaluated in order, so if the first node is present then it will
  257. be used to determine the quorate partition, if that node is not in either
  258. half (ie was not in the cluster before the split) then the second node ID
  259. will be checked for and so on. ATB is incompatible with quorum devices -
  260. if auto_tie_breaker is specified in corosync.conf then the quorum device
  261. will be disabled.
  262. .PP
  263. Example configuration 1:
  264. .nf
  265. quorum {
  266. provider: corosync_votequorum
  267. expected_votes: 8
  268. auto_tie_breaker: 1
  269. auto_tie_breaker_node: lowest
  270. }
  271. .fi
  272. .PP
  273. Example configuration 2:
  274. .nf
  275. quorum {
  276. provider: corosync_votequorum
  277. expected_votes: 8
  278. auto_tie_breaker: 1
  279. auto_tie_breaker_node: 1 3 5
  280. }
  281. .PP
  282. .fi
  283. .PP
  284. .B allow_downscale: 1
  285. .PP
  286. Enables allow downscale (AD) feature (default: 0).
  287. .PP
  288. THIS FEATURE IS INCOMPLETE AND CURRENTLY UNSUPPORTED.
  289. .PP
  290. The general behaviour of votequorum is to never decrease expected votes or quorum.
  291. .PP
  292. When AD is enabled, both expected votes and quorum are recalculated when
  293. a node leaves the cluster in a clean state (normal corosync shutdown process) down
  294. to configured expected_votes.
  295. .PP
  296. Example use case:
  297. .PP
  298. .nf
  299. 1) N node cluster (where N is any value higher than 3)
  300. 2) expected_votes set to 3 in corosync.conf
  301. 3) only 3 nodes are running
  302. 4) admin requires to increase processing power and adds 10 nodes
  303. 5) internal expected_votes is automatically set to 13
  304. 6) minimum expected_votes is 3 (from configuration)
  305. - up to this point this is standard votequorum behavior -
  306. 7) once the work is done, admin wants to remove nodes from the cluster
  307. 8) using an ordered shutdown the admin can reduce the cluster size
  308. automatically back to 3, but not below 3, where normal quorum
  309. operation will work as usual.
  310. .fi
  311. .PP
  312. Example configuration:
  313. .nf
  314. quorum {
  315. provider: corosync_votequorum
  316. expected_votes: 3
  317. allow_downscale: 1
  318. }
  319. .fi
  320. allow_downscale implicitly enabled EVT (see below).
  321. .PP
  322. .B expected_votes_tracking: 1
  323. .PP
  324. Enables Expected Votes Tracking (EVT) feature (default: 0).
  325. .PP
  326. Expected Votes Tracking stores the highest-seen value of expected votes on disk and uses
  327. that as the minimum value for expected votes in the absence of any higher authority (eg
  328. a current quorate cluster). This is useful for when a group of nodes becomes detached from
  329. the main cluster and after a restart could have enough votes to provide quorum, which can
  330. happen after using allow_downscale.
  331. .PP
  332. Note that even if the in-memory version of expected_votes is reduced, eg by removing nodes
  333. or using corosync-quorumtool, the stored value will still be the highest value seen - it
  334. never gets reduced.
  335. .PP
  336. The value is held in the file ev_tracking (stored in the directory configured in system.state_dir
  337. or /var/lib/corosync/ when unset) which can be deleted if you
  338. really do need to reduce the expected votes for any reason, like the node has been moved
  339. to a different cluster.
  340. .PP
  341. .fi
  342. .PP
  343. .SH VARIOUS NOTES
  344. .PP
  345. * WFA / LMS / ATB / AD can be used combined together.
  346. .PP
  347. * In order to change the default votes for a node there are two options:
  348. .nf
  349. 1) nodelist:
  350. nodelist {
  351. node {
  352. ring0_addr: 192.168.1.1
  353. quorum_votes: 3
  354. }
  355. ....
  356. }
  357. 2) quorum section (deprecated):
  358. quorum {
  359. provider: corosync_votequorum
  360. expected_votes: 2
  361. votes: 2
  362. }
  363. .fi
  364. In the event that both nodelist and quorum { votes: } are defined, the value
  365. from the nodelist will be used.
  366. .PP
  367. * Only votes, quorum_votes, expected_votes and two_node can be changed at runtime. Everything else
  368. requires a cluster restart.
  369. .SH BUGS
  370. No known bugs at the time of writing. The authors are from outerspace. Deal with it.
  371. .SH "SEE ALSO"
  372. .BR corosync (8),
  373. .BR corosync.conf (5),
  374. .BR corosync-quorumtool (8),
  375. .BR corosync-qdevice (8),
  376. .BR votequorum_overview (3)
  377. .PP