votequorum.5 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. .\"/*
  2. .\" * Copyright (c) 2012 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 2012-01-24 "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 occours, the
  213. remaining node will not be quorate. LMS does not work with asymmetric voting
  214. schemes, each node must vote 1.
  215. .PP
  216. Example configuration 1:
  217. .nf
  218. quorum {
  219. provider: corosync_votequorum
  220. expected_votes: 8
  221. last_man_standing: 1
  222. }
  223. .fi
  224. .PP
  225. Example configuration 2 (increase timeout to 20 seconds):
  226. .nf
  227. quorum {
  228. provider: corosync_votequorum
  229. expected_votes: 8
  230. last_man_standing: 1
  231. last_man_standing_window: 20000
  232. }
  233. .fi
  234. .PP
  235. .B auto_tie_breaker: 1
  236. .PP
  237. Enables Auto Tie Breaker (ATB) feature (default: 0).
  238. .PP
  239. The general behaviour of votequorum allows a simultaneous node failure up
  240. to 50% - 1 node, assuming each node has 1 vote.
  241. .PP
  242. When ATB is enabled, the cluster can suffer up to 50% of the nodes failing
  243. at the same time, in a deterministic fashion. The cluster partition, or the
  244. set of nodes that are still in contact with the node that has the lowest
  245. nodeid will remain quorate. The other nodes will be inquorate.
  246. .PP
  247. NOTES: For ATB to work, the lowest nodeid in the cluster needs to be known.
  248. corosync can automatically generate a nodeid or it can be overridden manually.
  249. If nodeids are not known at startup, ATB will automatically enable WFA.
  250. WFA will guarantee that all nodeids in the cluster are known before ATB can
  251. operate correctly.
  252. .PP
  253. Example configuration 1:
  254. .nf
  255. quorum {
  256. provider: corosync_votequorum
  257. expected_votes: 8
  258. auto_tie_breaker: 1
  259. }
  260. .fi
  261. this will also automatically enable WFA.
  262. .PP
  263. Example configuration 2:
  264. .nf
  265. quorum {
  266. provider: corosync_votequorum
  267. auto_tie_breaker: 1
  268. }
  269. nodelist {
  270. node {
  271. ring0_addr: 192.168.1.1
  272. nodeid: 1
  273. }
  274. node {
  275. ring0_addr: 192.168.1.2
  276. nodeid: 2
  277. }
  278. node {
  279. ring0_addr: 192.168.1.3
  280. nodeid: 3
  281. }
  282. node {
  283. ring0_addr: 192.168.1.4
  284. nodeid: 4
  285. }
  286. }
  287. .fi
  288. this will allow ATB to work without WFA as all nodeids are known at startup.
  289. .SH VARIOUS NOTES
  290. .PP
  291. * WFA / LMS / ATB can be used combined together.
  292. .PP
  293. * In order to change the default votes for a node there are two options:
  294. .nf
  295. 1) nodelist:
  296. nodelist {
  297. node {
  298. ring0_addr: 192.168.1.1
  299. quorum_votes: 3
  300. }
  301. ....
  302. }
  303. 2) quorum section (deprecated):
  304. quorum {
  305. provider: corosync_votequorum
  306. expected_votes: 2
  307. votes: 2
  308. }
  309. .fi
  310. In the event that both nodelist and quorum { votes: } are defined, the value
  311. from the nodelist will be used.
  312. .PP
  313. * Only votes, quorum_votes, expected_votes and two_node can be changed at runtime. Everything else
  314. requires a cluster restart.
  315. .SH BUGS
  316. No known bugs at the time of writing. The authors are from outerspace. Deal with it.
  317. .SH "SEE ALSO"
  318. .BR corosync (8),
  319. .BR corosync.conf (5),
  320. .BR corosync-quorumtool (8),
  321. .BR votequorum_overview (8)
  322. .PP