corosync-qdevice.8 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. .\"/*
  2. .\" * Copyright (C) 2016-2017 Red Hat, Inc.
  3. .\" *
  4. .\" * All rights reserved.
  5. .\" *
  6. .\" * Author: Jan Friesse <jfriesse@redhat.com>
  7. .\" *
  8. .\" * This software licensed under BSD license, the text of which follows:
  9. .\" *
  10. .\" * Redistribution and use in source and binary forms, with or without
  11. .\" * modification, are permitted provided that the following conditions are met:
  12. .\" *
  13. .\" * - Redistributions of source code must retain the above copyright notice,
  14. .\" * this list of conditions and the following disclaimer.
  15. .\" * - Redistributions in binary form must reproduce the above copyright notice,
  16. .\" * this list of conditions and the following disclaimer in the documentation
  17. .\" * and/or other materials provided with the distribution.
  18. .\" * - Neither the name of Red Hat, Inc. nor the names of its
  19. .\" * contributors may be used to endorse or promote products derived from this
  20. .\" * software without specific prior written permission.
  21. .\" *
  22. .\" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  23. .\" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  24. .\" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  25. .\" * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  26. .\" * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  27. .\" * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  28. .\" * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  29. .\" * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  30. .\" * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  31. .\" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  32. .\" * THE POSSIBILITY OF SUCH DAMAGE.
  33. .\" */
  34. .TH COROSYNC-QDEVICE 8 2017-10-17
  35. .SH NAME
  36. corosync-qdevice \- QDevice daemon
  37. .SH SYNOPSIS
  38. .B "corosync-qdevice [-dfh] [-S option=value[,option2=value2,...]]"
  39. .SH DESCRIPTION
  40. .B corosync-qdevice
  41. is a daemon running on each node of a cluster. It provides a configured
  42. number of votes to the
  43. quorum subsystem based on a third-party arbitrator's decision. Its primary use
  44. is to allow a cluster to sustain more node failures than standard quorum rules allow.
  45. It is recommended for clusters with an even number of nodes and highly recommended
  46. for 2 node clusters.
  47. .SH OPTIONS
  48. .TP
  49. .B -d
  50. Forcefully turn on debug information without the need to change corosync.conf.
  51. .TP
  52. .B -f
  53. Do not daemonize, run in the foreground.
  54. .TP
  55. .B -h
  56. Show short help text
  57. .TP
  58. .B -S
  59. Set advanced settings described in its own section below. This option
  60. shouldn't be generally used because most of the options are
  61. not safe to change.
  62. .SH CONFIGURATION
  63. .B corosync-qdevice
  64. reads its configuration from corosync.conf file.
  65. The main configuration is within
  66. .B quorum.device
  67. sub-key. Each model also has its own configuration within a
  68. similarly named sub-key.
  69. .TP
  70. .B model
  71. Specifies the model to be used. This parameter is required.
  72. .B corosync-qdevice
  73. is modular and is able to support multiple different models. The model basically
  74. defines what type of arbitrator is used. Currently only
  75. .I net
  76. is supported.
  77. .TP
  78. .B timeout
  79. Specifies how often
  80. .B corosync-qdevice
  81. should call the votequorum_poll function. It is also used by the net model to adjust
  82. its hearbeat timeout. It is recommended that you don't change this value.
  83. Default is 10000.
  84. .TP
  85. .B sync_timeout
  86. Specifies how often
  87. .B corosync-qdevice
  88. should call the votequorum_poll function during a sync phase. It is recommended that you don't change this value.
  89. Default is 30000.
  90. .TP
  91. .B votes
  92. The number of votes provided to the cluster by qdevice. Default is (number_of_nodes - 1) or generally
  93. sum(votes_per_node) - 1.
  94. .PP
  95. .B quorum.device.heuristics
  96. subkey holds the configuration of the heuristics. Heuristics are set of commands executed locally on
  97. startup, cluster membership change, successful connect to
  98. .B corosync-qnetd
  99. and optionally also at regular times. When all commands finish successfully
  100. (their return error code is zero) on time,
  101. heuristics have passed, otherwise they have failed. The heuristics result is sent to
  102. .B corosync-qnetd
  103. and there it's used in calculations to determine which partition should be quorate.
  104. .TP
  105. .B timeout
  106. Specifies maximum time in milliseconds how long
  107. .B corosync-qdevice
  108. waits till the heuristics commands finish. If some command doesn't finish before the timeout, it's
  109. killed and heuristics fail. This timeout is used for heuristics executed at regular times.
  110. Default value is half of the quorum.device.timeout, so 5000.
  111. .TP
  112. .B sync_timeout
  113. Similar to quorum.device.heuristics.timeout but used during membership changes. Default
  114. value is half of the quorum.device.sync_timeout, so 15000.
  115. .TP
  116. .B interval
  117. Specifies interval between two regular heuristics execution. Default value is
  118. 3 * quorum.device.timeout, so 30000.
  119. .TP
  120. .B mode
  121. Can be on of
  122. .IR on ", " sync " or " off
  123. and specifies mode of operation of heuristics. Default is
  124. .I off
  125. what means heuristics are disabled. When
  126. .I sync
  127. is set, heuristics are executed only during startup, membership change and when connection
  128. to
  129. .B corosync-qnetd
  130. is established. When heuristics should be running also on regular basis, this option
  131. should be set to
  132. .I on
  133. value.
  134. .TP
  135. .B exec_NAME
  136. defines executables.
  137. .I NAME
  138. can be arbitrary valid cmap key name string and it has no special meaning.
  139. The value of this variable must contain a command to execute. The value is parsed (split)
  140. into arguments similarly as Bourne shell would do. Quoting is possible by
  141. using backslash and double quotes.
  142. .PP
  143. .B quorum.device.net
  144. subkey holds the configuration for model 'net'.
  145. .TP
  146. .B tls
  147. Can be one of
  148. .IR on ", " off " or " required
  149. and specifies if tls should be used.
  150. .I on
  151. means a connection with TLS is attempted first, but if the server doesn't advertise TLS support
  152. then non-TLS will be used.
  153. .I off
  154. is used then TLS is not required and it's then not even tried. This mode is the
  155. only one which doesn't need a properly initialized NSS database.
  156. .I required
  157. means TLS is required and if the server doesn't support TLS, qdevice will
  158. exit with error message. Default is
  159. .IR on .
  160. .TP
  161. .B host
  162. Specifies the IP address or host name of the qnetd server to be used. This parameter
  163. is required.
  164. .TP
  165. .B port
  166. Specifies TCP port of qnetd server. Default is 5403.
  167. .TP
  168. .B algorithm
  169. Decision algorithm. Can be one of the
  170. .I ffsplit
  171. or
  172. .IR lms .
  173. (actually there are also
  174. .I test
  175. and
  176. .IR 2nodelms ,
  177. both of which are mainly for developers and shouldn't be used for production clusters).
  178. For a description of what each algorithm means and how the algorithms differ see their
  179. individual sections.
  180. Default value is
  181. .IR ffsplit .
  182. .TP
  183. .B tie_breaker
  184. can be one of
  185. .IR lowest ", " highest
  186. or valid_node_id (number) values. It's used as a fallback if qdevice has to decide between two or more
  187. equal partitions.
  188. .I lowest
  189. means the partition with the lowest node id is chosen.
  190. .I highest
  191. means the partition with highest node id is chosen. And valid_node_id means that the partition
  192. containing the node with the given node id is chosen.
  193. Default is
  194. .IR lowest .
  195. .TP
  196. .B connect_timeout
  197. Timeout when
  198. .B corosync-qdevice
  199. is trying to connect to
  200. .B corosync-qnetd
  201. host. Default is 0.8 * quorum.sync_timeout.
  202. .TP
  203. .B force_ip_version
  204. can be one of
  205. .I 0|4|6
  206. and forces the software to use the given IP version.
  207. .I 0
  208. (default value) means IPv6 is preferred and IPv4 should be used as a fallback.
  209. .PP
  210. Logging configuration is within the
  211. .B logging
  212. directive.
  213. .B corosync-qdevice
  214. parses and supports most of the options with exception of
  215. .BR to_logfile ", " logfile
  216. and
  217. .BR logfile_priority .
  218. The
  219. .B logger_subsys
  220. sub-directive can be also used if
  221. .B subsys
  222. is set to QDEVICE.
  223. .PP
  224. For
  225. .B corosync-qdevice
  226. to work correctly, the
  227. .B nodelist
  228. directive has to be used and properly configured. Also the net model requires that
  229. .B totem.cluster_name
  230. option is set.
  231. .SH MODEL NET TLS CONFIGURATION
  232. For model net to work using TLS, it's necessary to create the NSS database, import Qnetd
  233. CA certificate, and get/distribute a valid client certificate.
  234. If pcs is used (recommended) the following steps are not needed because pcs does them automatically.
  235. .B corosync-qdevice-net-certutil
  236. is the tool to perform required actions semi-automatically. Please consult the help output of
  237. it and its man page. For a first time configuration it may make sense to start with the
  238. .B -Q
  239. option.
  240. If TLS is not required just edit corosync.conf file and set
  241. .B quorum.device.net.tls
  242. to
  243. .IR off .
  244. .SH MODEL NET ALGORITHMS
  245. Algorithms are used to change behavior of how
  246. .B corosync-qnetd
  247. provides votes to a given node/partition. Currently there are two algorithms supported.
  248. .TP
  249. .B ffsplit
  250. This one makes sense only for clusters with an even number of nodes. It provides exactly one
  251. vote to the partition with the highest number of active nodes. If there are two exactly
  252. similar partitions,
  253. it provides its vote to the partition with higher score. The score is computed
  254. as (number_of_connected_nodes +
  255. number_of_connected_nodes_with_passed_heuristics - number_of_connected_nodes_with_failed_heuristics)
  256. If the scores are equal, the vote is provided to partition with the most clients connected to the qnetd
  257. server. If this number is also equal, then the tie_breaker is used. It is able to transition
  258. its vote if the currently active partition becomes partitioned and a non-active partition
  259. still has at least 50% of the active nodes. Because of this, a vote is not provided
  260. if the qnetd connection is not active.
  261. To use this algorithm it's required to set the number of votes per node to 1 (default)
  262. and the qdevice number of votes has to be also 1. This is achieved by setting
  263. .B quorum.device.votes
  264. key in corosync.conf file to 1.
  265. .TP
  266. .B lms
  267. Last-man-standing. If the node is the only one left in the cluster that can see the
  268. qnetd server then we return a vote.
  269. If more than one node can see the qnetd server but some nodes can't
  270. see each other then the cluster is divided up into 'partitions' based on
  271. their ring_id and this algorithm returns a vote to the partition with highest
  272. heuristics score (computed the same way as for the
  273. .B ffsplit
  274. algorithm), or if there is more than 1 partition with equal scores,
  275. the largest active partition or,
  276. if there is more than 1 equal partition, the partition that contains the tie_breaker
  277. node (lowest, highest, etc). For LMS to work, the number
  278. of qdevice votes has to be set to default (so just delete
  279. .B quorum.device.votes
  280. key from corosync.conf).
  281. .SH ADVANCED SETTINGS
  282. Set by using
  283. .B -S
  284. option. The default value is shown in parentheses) Options
  285. beginning with
  286. .B net_
  287. prefix are specific to model net.
  288. .TP
  289. .B lock_file
  290. Lock file location. (/var/run/corosync-qdevice/corosync-qdevice.pid)
  291. .TP
  292. .B local_socket_file
  293. Internal IPC socket file location. (/var/run/corosync-qdevice/corosync-qdevice.sock)
  294. .TP
  295. .B local_socket_backlog
  296. Parameter passed to listen syscall. (10)
  297. .TP
  298. .B max_cs_try_again
  299. How many times to retry the call to a corosync function which has returned CS_ERR_TRY_AGAIN. (10)
  300. .TP
  301. .B votequorum_device_name
  302. Name used for qdevice registration. (Qdevice)
  303. .TP
  304. .B ipc_max_clients
  305. Maximum allowed simultaneous IPC clients. (10)
  306. .TP
  307. .B ipc_max_receive_size
  308. Maximum size of a message received by IPC client. (4096)
  309. .TP
  310. .B ipc_max_send_size
  311. Maximum size of a message allowed to be sent to an IPC client. (65536)
  312. .TP
  313. .B master_wins
  314. Force enable/disable master wins. (default is model)
  315. .TP
  316. .B heuristics_ipc_max_send_buffers
  317. Maximum number of heuristics worker send buffers. (128)
  318. .TP
  319. .B heuristics_ipc_max_send_receive_size
  320. Maximum size of a message allowed to be send to, or received from heuristics worker. (4096)
  321. .TP
  322. .B heuristics_min_timeout
  323. Minimum heuristics timeout accepted by client in ms. (1000)
  324. .TP
  325. .B heuristics_max_timeout
  326. Maximum heuristics timeout accepted by client in ms. (120000)
  327. .TP
  328. .B heuristics_min_interval
  329. Minimum heuristics interval accepted by client in ms. (1000)
  330. .TP
  331. .B heuristics_max_interval
  332. Maximum heuristics interval accepted by client in ms. (3600000)
  333. .TP
  334. .B heuristics_max_execs
  335. Maximum number of exec_ commands. (32)
  336. .TP
  337. .B heuristics_use_execvp
  338. Use execvp instead of execv for executing commands. (off)
  339. .TP
  340. .B heuristics_max_processes
  341. Maximum number of processes running at one time. (160)
  342. .B heuristics_kill_list_interval
  343. Interval between status is gathered and eventually signal is sent
  344. to processes which didn't finished on time in ms. (5000)
  345. .TP
  346. .B net_nss_db_dir
  347. NSS database directory. (/etc/corosync/qdevice/net/nssdb)
  348. .TP
  349. .B net_initial_msg_receive_size
  350. Initial (used during connection parameters negotiation)
  351. maximum size of the receive buffer for message (maximum
  352. allowed message size received from qnetd). (32768)
  353. .TP
  354. .B net_initial_msg_send_size
  355. Initial (used during connection parameter negotiation)
  356. maximum size of one send buffer (message) to be sent to server. (32768)
  357. .TP
  358. .B net_min_msg_send_size
  359. Minimum required size of one send buffer (message) to be sent to server. (32768)
  360. .TP
  361. .B net_max_msg_receive_size
  362. Maximum allowed size of receive buffer for a message sent by server. (16777216)
  363. .TP
  364. .B net_max_send_buffers
  365. Maximum number of send buffers. (10)
  366. .TP
  367. .B net_nss_qnetd_cn
  368. Canonical name of qnetd server certificate. (Qnetd Server)
  369. .TP
  370. .B net_nss_client_cert_nickname
  371. NSS nickname of qdevice client certificate. (Cluster Cert)
  372. .TP
  373. .B net_heartbeat_interval_min
  374. Minimum heartbeat timeout accepted by client in ms. (1000)
  375. .TP
  376. .B net_heartbeat_interval_max
  377. Maximum heartbeat timeout accepted by client in ms. (120000)
  378. .TP
  379. .B net_min_connect_timeout
  380. Minimum connection timeout accepted by client in ms. (1000)
  381. .TP
  382. .B net_max_connect_timeout
  383. Maximum connection timeout accepted by client in ms. (120000)
  384. .TP
  385. .B net_test_algorithm_enabled
  386. Enable test algorithm. (if built with --enable-debug on, otherwise off)
  387. .SH EXAMPLE
  388. Define qdevice with
  389. .I net
  390. model connecting to qnetd running on qnetd.example.org host, using ffsplit algorithm.
  391. Heuristics is set to
  392. .I sync
  393. mode and executes two commands.
  394. .nf
  395. quorum {
  396. provider: corosync_votequorum
  397. device {
  398. votes: 1
  399. model: net
  400. net {
  401. tls: on
  402. host: qnetd.example.org
  403. algorithm: ffsplit
  404. }
  405. heuristics {
  406. mode: sync
  407. exec_ping: /bin/ping -q -c 1 "www.example.org"
  408. exec_test_txt_exists: /usr/bin/test -f /tmp/test.txt
  409. }
  410. }
  411. .fi
  412. .SH SEE ALSO
  413. .BR corosync-qdevice-tool (8)
  414. .BR corosync-qdevice-net-certutil (8)
  415. .BR corosync-qnetd (8)
  416. .BR corosync.conf (5)
  417. .SH AUTHOR
  418. Jan Friesse
  419. .PP