corosync.conf.5 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045
  1. .\"/*
  2. .\" * Copyright (c) 2005 MontaVista Software, Inc.
  3. .\" * Copyright (c) 2006-2021 Red Hat, Inc.
  4. .\" *
  5. .\" * All rights reserved.
  6. .\" *
  7. .\" * Author: Steven Dake (sdake@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 COROSYNC_CONF 5 2021-08-11 "corosync Man Page" "Corosync Cluster Engine Programmer's Manual"
  36. .SH NAME
  37. corosync.conf - corosync executive configuration file
  38. .SH SYNOPSIS
  39. /etc/corosync/corosync.conf
  40. .SH DESCRIPTION
  41. The corosync.conf instructs the corosync executive about various parameters
  42. needed to control the corosync executive. Empty lines and lines starting with
  43. # character are ignored. The configuration file consists of bracketed top level
  44. directives. The possible directive choices are:
  45. .TP
  46. totem { }
  47. This top level directive contains configuration options for the totem protocol.
  48. .TP
  49. logging { }
  50. This top level directive contains configuration options for logging.
  51. .TP
  52. quorum { }
  53. This top level directive contains configuration options for quorum.
  54. .TP
  55. nodelist { }
  56. This top level directive contains configuration options for nodes in cluster.
  57. .TP
  58. system { }
  59. This top level directive contains configuration options related to system.
  60. .TP
  61. resources { }
  62. This top level directive contains configuration options for resources.
  63. .TP
  64. nozzle { }
  65. This top level directive contains configuration options for a libnozzle device.
  66. .PP
  67. The
  68. .B interface sub-directive of totem is optional for UDP and knet transports.
  69. For knet, multiple interface subsections define parameters for each knet link on the
  70. system.
  71. For UDPU an interface section is not needed and it is recommended that the nodelist
  72. is used to define cluster nodes.
  73. .TP
  74. linknumber
  75. This specifies the link number for the interface. When using the knet
  76. protocol, each interface should specify separate link numbers to uniquely
  77. identify to the membership protocol which interface to use for which link.
  78. The linknumber must start at 0. For UDP the only supported linknumber is 0.
  79. .TP
  80. knet_link_priority
  81. This specifies the priority for the link when knet is used in 'passive'
  82. mode. (see link_mode below)
  83. .TP
  84. knet_ping_interval
  85. This specifies the interval between knet link pings.
  86. knet_ping_interval and knet_ping_timeout
  87. are a pair, if one is specified the other should be too, otherwise one will be calculated from
  88. the token timeout and one will be taken from the config file.
  89. (default is token timeout / (knet_pong_count*2))
  90. .TP
  91. knet_ping_timeout
  92. If no ping is received within this time, the knet link is declared dead.
  93. knet_ping_interval and knet_ping_timeout
  94. are a pair, if one is specified the other should be too, otherwise one will be calculated from
  95. the token timeout and one will be taken from the config file.
  96. (default is token timeout / knet_pong_count)
  97. .TP
  98. knet_ping_precision
  99. How many values of latency are used to calculate
  100. the average link latency. (default 2048 samples)
  101. .TP
  102. knet_pong_count
  103. How many valid ping/pongs before a link is marked UP. (default 2)
  104. .TP
  105. knet_transport
  106. Which IP transport knet should use. valid values are "sctp" or "udp". (default: udp)
  107. .TP
  108. bindnetaddr (udp only)
  109. This specifies the network address the corosync executive should bind
  110. to when using udp.
  111. bindnetaddr (udp only)
  112. should be an IP address configured on the system, or a network
  113. address.
  114. For example, if the local interface is 192.168.5.92 with netmask
  115. 255.255.255.0, you should set bindnetaddr to 192.168.5.92 or 192.168.5.0.
  116. If the local interface is 192.168.5.92 with netmask 255.255.255.192,
  117. set bindnetaddr to 192.168.5.92 or 192.168.5.64, and so forth.
  118. This may also be an IPV6 address, in which case IPV6 networking will be used.
  119. In this case, the exact address must be specified and there is no automatic
  120. selection of the network interface within a specific subnet as with IPv4.
  121. If IPv6 networking is used, the nodeid field in nodelist must be specified.
  122. .TP
  123. broadcast (udp only)
  124. This is optional and can be set to yes. If it is set to yes, the broadcast
  125. address will be used for communication. If this option is set, mcastaddr
  126. should not be set.
  127. .TP
  128. mcastaddr (udp only)
  129. This is the multicast address used by corosync executive. The default
  130. should work for most networks, but the network administrator should be queried
  131. about a multicast address to use. Avoid 224.x.x.x because this is a "config"
  132. multicast address.
  133. This may also be an IPV6 multicast address, in which case IPV6 networking
  134. will be used. If IPv6 networking is used, the nodeid field in nodelist must
  135. be specified.
  136. It's not necessary to use this option if cluster_name option is used. If both options
  137. are used, mcastaddr has higher priority.
  138. .TP
  139. mcastport (udp only)
  140. This specifies the UDP port number. It is possible to use the same multicast
  141. address on a network with the corosync services configured for different
  142. UDP ports.
  143. Please note corosync uses two UDP ports mcastport (for mcast receives) and
  144. mcastport - 1 (for mcast sends).
  145. If you have multiple clusters on the same network using the same mcastaddr
  146. please configure the mcastports with a gap.
  147. .TP
  148. ttl (udp only)
  149. This specifies the Time To Live (TTL). If you run your cluster on a routed
  150. network then the default of "1" will be too small. This option provides
  151. a way to increase this up to 255. The valid range is 0..255.
  152. .PP
  153. .PP
  154. Within the
  155. .B totem
  156. directive, there are seven configuration options of which one is required,
  157. five are optional, and one is required when IPV6 is configured in the interface
  158. subdirective. The required directive controls the version of the totem
  159. configuration. The optional option unless using IPV6 directive controls
  160. identification of the processor. The optional options control secrecy and
  161. authentication, the network mode of operation and maximum network MTU
  162. field.
  163. .TP
  164. version
  165. This specifies the version of the configuration file. Currently the only
  166. valid version for this directive is 2.
  167. .TP
  168. clear_node_high_bit
  169. This configuration option is optional and is only relevant when no nodeid is
  170. specified. Some corosync clients require a signed 32 bit nodeid that is greater
  171. than zero however by default corosync uses all 32 bits of the IPv4 address space
  172. when generating a nodeid. Set this option to yes to force the high bit to be
  173. zero and therefore ensure the nodeid is a positive signed 32 bit integer.
  174. WARNING: Cluster behavior is undefined if this option is enabled on only
  175. a subset of the cluster (for example during a rolling upgrade).
  176. .TP
  177. crypto_model
  178. This specifies which cryptographic library should be used by knet.
  179. Supported values depend on the libknet build and on the installed
  180. cryptography libraries. Typically nss and openssl will be available
  181. but gcrypt and others could also be allowed.
  182. The default is nss.
  183. .TP
  184. crypto_hash
  185. This specifies which HMAC authentication should be used to authenticate all
  186. messages. Valid values are none (no authentication), md5, sha1, sha256,
  187. sha384 and sha512. Encrypted transmission is only supported for
  188. the knet transport.
  189. The default is none.
  190. .TP
  191. crypto_cipher
  192. This specifies which cipher should be used to encrypt all messages.
  193. Valid values are none (no encryption), aes256, aes192 and aes128.
  194. Enabling crypto_cipher, requires also enabling of crypto_hash. Encrypted
  195. transmission is only supported for the knet transport.
  196. The default is none.
  197. .TP
  198. secauth
  199. This implies crypto_cipher=aes256 and crypto_hash=sha256, unless those options
  200. are explicitly set. Encrypted transmission is only supported for the knet
  201. transport.
  202. The default is off.
  203. .TP
  204. keyfile
  205. This specifies the fully qualified path to the shared key used to
  206. authenticate and encrypt data used within the Totem protocol.
  207. The default is /etc/corosync/authkey.
  208. .TP
  209. key
  210. Shared key stored in configuration instead of authkey file. This option
  211. has lower precedence than keyfile option so it's
  212. used only when keyfile is not specified.
  213. Using this option is not recommended for security reasons.
  214. .TP
  215. link_mode
  216. This specifies the Kronosnet mode, which may be passive, active, or
  217. rr (round-robin).
  218. .B passive:
  219. the active link with the highest priority (highest number) will be used. If one or more
  220. links share the same priority the one with the lowest link ID will
  221. be used.
  222. .B active:
  223. All active links will be used simultaneously to send traffic.
  224. link priority is ignored.
  225. .B rr:
  226. Round-Robin policy. Each packet will be sent to the next active link in
  227. order.
  228. If only one interface directive is specified, passive is automatically chosen.
  229. The maximum number of interface directives that is allowed with Kronosnet
  230. is 8. For other transports it is 1.
  231. .TP
  232. netmtu
  233. This specifies the network maximum transmit unit. To set this value beyond
  234. 1500, the regular frame MTU, requires ethernet devices that support large, or
  235. also called jumbo, frames. If any device in the network doesn't support large
  236. frames, the protocol will not operate properly. The hosts must also have their
  237. mtu size set from 1500 to whatever frame size is specified here.
  238. Please note while some NICs or switches claim large frame support, they support
  239. 9000 MTU as the maximum frame size including the IP header. Setting the netmtu
  240. and host MTUs to 9000 will cause totem to use the full 9000 bytes of the frame.
  241. Then Linux will add a 18 byte header moving the full frame size to 9018. As a
  242. result some hardware will not operate properly with this size of data. A netmtu
  243. of 8982 seems to work for the few large frame devices that have been tested.
  244. Some manufacturers claim large frame support when in fact they support frame
  245. sizes of 4500 bytes.
  246. When sending multicast traffic, if the network frequently reconfigures, chances are
  247. that some device in the network doesn't support large frames.
  248. Choose hardware carefully if intending to use large frame support.
  249. The default is 1500.
  250. .TP
  251. transport
  252. This directive controls the transport mechanism used.
  253. The default is knet. The transport type can also be set to udpu or udp.
  254. Only knet allows crypto or multiple interfaces per node.
  255. .TP
  256. cluster_name
  257. This specifies the name of cluster and it's used for automatic generating
  258. of multicast address.
  259. .TP
  260. config_version
  261. This specifies version of config file. This is converted to unsigned 64-bit int.
  262. By default it's 0. Option is used to prevent joining old nodes with not
  263. up-to-date configuration. If value is not 0, and node is going for first time
  264. (only for first time, join after split doesn't follow this rules)
  265. from single-node membership to multiple nodes membership, other nodes
  266. config_versions are collected. If current node config_version is not
  267. equal to highest of collected versions, corosync is terminated.
  268. .TP
  269. ip_version
  270. This specifies version of IP to ask DNS resolver for.
  271. The value can be one of
  272. .B ipv4
  273. (look only for an IPv4 address)
  274. ,
  275. .B ipv6
  276. (check only IPv6 address)
  277. ,
  278. .B ipv4-6
  279. (look for all address families and use first IPv4 address found in the list if there is such address,
  280. otherwise use first IPv6 address) and
  281. .B ipv6-4
  282. (look for all address families and use first IPv6 address found in the list if there is such address,
  283. otherwise use first IPv4 address).
  284. Default (if unspecified) is
  285. .B ipv6-4
  286. for knet and udpu transports and
  287. .B ipv4
  288. for udp.
  289. The knet transport supports IPv4 and IPv6 addresses concurrently,
  290. provided they are consistent on each link.
  291. Within the
  292. .B totem
  293. directive, there are several configuration options which are used to control
  294. the operation of the protocol. It is generally not recommended to change any
  295. of these values without proper guidance and sufficient testing. Some networks
  296. may require larger values if suffering from frequent reconfigurations. Some
  297. applications may require faster failure detection times which can be achieved
  298. by reducing the token timeout.
  299. .TP
  300. token
  301. This timeout is used directly or as a base for real token timeout calculation (explained in
  302. .B token_coefficient
  303. section). Token timeout specifies in milliseconds until a token loss is declared after not
  304. receiving a token. This is the time spent detecting a failure of a processor
  305. in the current configuration. Reforming a new configuration takes about 50
  306. milliseconds in addition to this timeout.
  307. For real token timeout used by totem it's possible to read cmap value of
  308. .B runtime.config.totem.token
  309. key.
  310. Be careful to use the same timeout values on each of the nodes in the cluster
  311. or unpredictable results may occur.
  312. The default is 3000 milliseconds.
  313. .TP
  314. token_warning
  315. Specifies the interval between warnings that the token has not been received. The
  316. value is a percentage of the token timeout and can be set to 0 to disable
  317. warnings.
  318. The default is 75%.
  319. .TP
  320. token_coefficient
  321. This value is used only when
  322. .B nodelist
  323. section is specified and contains at least 3 nodes. If so, real token timeout
  324. is then computed as token + (number_of_nodes - 2) * token_coefficient.
  325. This allows cluster to scale without manually changing token timeout
  326. every time new node is added. This value can be set to 0 resulting
  327. in effective removal of this feature.
  328. The default is 650 milliseconds.
  329. .TP
  330. token_retransmit
  331. This timeout specifies in milliseconds after how long before receiving a token
  332. the token is retransmitted. This will be automatically calculated if token
  333. is modified. It is not recommended to alter this value without guidance from
  334. the corosync community.
  335. The minimum is 30 milliseconds. If not set and error occur, make sure
  336. token / (token_retransmits_before_loss_const + 0.2) is more than 30.
  337. The default is 238 milliseconds for two nodes cluster. Three or more nodes reference
  338. .B token_coefficient.
  339. .TP
  340. knet_compression_model
  341. Type of compression used by Kronosnet. Supported values depend on
  342. the libknet build and on the installed compression libraries. Typically zlib and lz4 will be available
  343. but bzip2 and others could also be allowed. The default is 'none'.
  344. .TP
  345. knet_compression_threshold
  346. Tells knet to NOT compress any packets that are smaller than the value
  347. indicated. Default 100 bytes.
  348. Set to 0 to reset to the default.
  349. Set to 1 to compress everything.
  350. .TP
  351. knet_compression_level
  352. Many compression libraries allow tuning of compression parameters. For example
  353. 0 or 1 ... 9 are commonly used to determine the level of compression. This value
  354. is passed unmodified to the compression library so it is recommended to consult
  355. the library's documentation for more detailed information.
  356. .TP
  357. hold
  358. This timeout specifies in milliseconds how long the token should be held by
  359. the representative when the protocol is under low utilization. It is not
  360. recommended to alter this value without guidance from the corosync community.
  361. The default is 180 milliseconds.
  362. .TP
  363. token_retransmits_before_loss_const
  364. This value identifies how many token retransmits should be attempted before
  365. forming a new configuration. It is also used for token_retransmit
  366. and hold calculations.
  367. The default is 4 retransmissions.
  368. .TP
  369. join
  370. This timeout specifies in milliseconds how long to wait for join messages in
  371. the membership protocol.
  372. The default is 50 milliseconds.
  373. .TP
  374. send_join
  375. This timeout specifies in milliseconds an upper range between 0 and send_join
  376. to wait before sending a join message. For configurations with less than
  377. 32 nodes, this parameter is not necessary. For larger rings, this parameter
  378. is necessary to ensure the NIC is not overflowed with join messages on
  379. formation of a new ring. A reasonable value for large rings (128 nodes) would
  380. be 80msec. Other timer values must also change if this value is changed. Seek
  381. advice from the corosync mailing list if trying to run larger configurations.
  382. The default is 0 milliseconds.
  383. .TP
  384. consensus
  385. This timeout specifies in milliseconds how long to wait for consensus to be
  386. achieved before starting a new round of membership configuration. The minimum
  387. value for consensus must be 1.2 * token. This value will be automatically
  388. calculated at 1.2 * token if the user doesn't specify a consensus value.
  389. For two node clusters, a consensus larger than the join timeout but less than
  390. token is safe. For three node or larger clusters, consensus should be larger
  391. than token. There is an increasing risk of odd membership changes, which still
  392. guarantee virtual synchrony, as node count grows if consensus is less than
  393. token.
  394. The default is 3600 milliseconds.
  395. .TP
  396. merge
  397. This timeout specifies in milliseconds how long to wait before checking for
  398. a partition when no multicast traffic is being sent. If multicast traffic
  399. is being sent, the merge detection happens automatically as a function of
  400. the protocol.
  401. The default is 200 milliseconds.
  402. .TP
  403. downcheck
  404. This timeout specifies in milliseconds how long to wait before checking
  405. that a network interface is back up after it has been downed.
  406. The default is 1000 milliseconds.
  407. .TP
  408. fail_recv_const
  409. This constant specifies how many rotations of the token without receiving any
  410. of the messages when messages should be received may occur before a new
  411. configuration is formed.
  412. The default is 2500 failures to receive a message.
  413. .TP
  414. seqno_unchanged_const
  415. This constant specifies how many rotations of the token without any multicast
  416. traffic should occur before the hold timer is started.
  417. The default is 30 rotations.
  418. .TP
  419. heartbeat_failures_allowed
  420. [HeartBeating mechanism]
  421. Configures the optional HeartBeating mechanism for faster failure detection. Keep in
  422. mind that engaging this mechanism in lossy networks could cause faulty loss declaration
  423. as the mechanism relies on the network for heartbeating.
  424. So as a rule of thumb use this mechanism if you require improved failure in low to
  425. medium utilized networks.
  426. This constant specifies the number of heartbeat failures the system should tolerate
  427. before declaring heartbeat failure e.g 3. Also if this value is not set or is 0 then the
  428. heartbeat mechanism is not engaged in the system and token rotation is the method
  429. of failure detection
  430. The default is 0 (disabled).
  431. .TP
  432. max_network_delay
  433. [HeartBeating mechanism]
  434. This constant specifies in milliseconds the approximate delay that your network takes
  435. to transport one packet from one machine to another. This value is to be set by system
  436. engineers and please don't change if not sure as this effects the failure detection
  437. mechanism using heartbeat.
  438. The default is 50 milliseconds.
  439. .TP
  440. window_size
  441. This constant specifies the maximum number of messages that may be sent on one
  442. token rotation. If all processors perform equally well, this value could be
  443. large (300), which would introduce higher latency from origination to delivery
  444. for very large rings. To reduce latency in large rings(16+), the defaults are
  445. a safe compromise. If 1 or more slow processor(s) are present among fast
  446. processors, window_size should be no larger than 256000 / netmtu to avoid
  447. overflow of the kernel receive buffers. The user is notified of this by
  448. the display of a retransmit list in the notification logs. There is no loss
  449. of data, but performance is reduced when these errors occur.
  450. The default is 50 messages.
  451. .TP
  452. max_messages
  453. This constant specifies the maximum number of messages that may be sent by one
  454. processor on receipt of the token. The max_messages parameter is limited to
  455. 256000 / netmtu to prevent overflow of the kernel transmit buffers.
  456. The default is 17 messages.
  457. .TP
  458. miss_count_const
  459. This constant defines the maximum number of times on receipt of a token
  460. a message is checked for retransmission before a retransmission occurs. This
  461. parameter is useful to modify for switches that delay multicast packets
  462. compared to unicast packets. The default setting works well for nearly all
  463. modern switches.
  464. The default is 5 messages.
  465. .TP
  466. knet_pmtud_interval
  467. How often the knet PMTUd runs to look for network MTU changes.
  468. Value in seconds, default: 30
  469. .TP
  470. block_unlisted_ips
  471. Allow UDPU and KNET to drop packets from IP addresses that are not known
  472. (nodes which don't exist in the nodelist) to corosync.
  473. Value is yes or no.
  474. This feature is mainly to protect against the joining of nodes
  475. with outdated configurations after a cluster split.
  476. Another use case is to allow the atomic merge of two independent clusters.
  477. Changing the default value is not recommended, the overhead is tiny and
  478. an existing cluster may fail if corosync is started on an unlisted node
  479. with an old configuration.
  480. The default value is yes.
  481. .TP
  482. cancel_token_hold_on_retransmit
  483. Allows Corosync to hold token by representative when there is too much
  484. retransmit messages. This allows network to process increased load without
  485. overloading it. Used mechanism is same as described for
  486. .B hold
  487. directive.
  488. Some deployments may prefer to never hold token when there is
  489. retransmit messages. If so, option should be set to yes.
  490. The default value is no.
  491. .PP
  492. Within the
  493. .B logging
  494. directive, there are several configuration options which are all optional.
  495. .PP
  496. The following 3 options are valid only for the top level logging directive:
  497. .TP
  498. timestamp
  499. This specifies that a timestamp is placed on all log messages. It can be one
  500. of off (no timestamp), on (second precision timestamp) or
  501. hires (millisecond precision timestamp - only when supported by LibQB).
  502. The default is hires (or on if hires is not supported).
  503. .TP
  504. fileline
  505. This specifies that file and line should be printed.
  506. The default is off.
  507. .TP
  508. function_name
  509. This specifies that the code function name should be printed.
  510. The default is off.
  511. .TP
  512. blackbox
  513. This specifies that blackbox functionality should be enabled.
  514. The default is on.
  515. .PP
  516. The following options are valid both for top level logging directive
  517. and they can be overridden in logger_subsys entries.
  518. .TP
  519. to_stderr
  520. .TP
  521. to_logfile
  522. .TP
  523. to_syslog
  524. These specify the destination of logging output. Any combination of
  525. these options may be specified. Valid options are
  526. .B yes
  527. and
  528. .B no.
  529. The default is syslog and stderr.
  530. Please note, if you are using to_logfile and want to rotate the file, use logrotate(8)
  531. with the option
  532. .B
  533. copytruncate.
  534. eg.
  535. .ne 18
  536. .RS
  537. .nf
  538. .ft CW
  539. /var/log/corosync.log {
  540. missingok
  541. compress
  542. notifempty
  543. daily
  544. rotate 7
  545. copytruncate
  546. }
  547. .ft
  548. .fi
  549. .RE
  550. .TP
  551. logfile
  552. If the
  553. .B to_logfile
  554. directive is set to
  555. .B yes
  556. , this option specifies the pathname of the log file.
  557. No default.
  558. .TP
  559. logfile_priority
  560. This specifies the logfile priority for this particular subsystem. Ignored if debug is on.
  561. Possible values are: alert, crit, debug (same as debug = on), emerg, err, info, notice, warning.
  562. The default is: info.
  563. .TP
  564. syslog_facility
  565. This specifies the syslog facility type that will be used for any messages
  566. sent to syslog. options are daemon, local0, local1, local2, local3, local4,
  567. local5, local6 & local7.
  568. The default is daemon.
  569. .TP
  570. syslog_priority
  571. This specifies the syslog level for this particular subsystem. Ignored if debug is on.
  572. Possible values are: alert, crit, debug (same as debug = on), emerg, err, info, notice, warning.
  573. The default is: info.
  574. .TP
  575. debug
  576. This specifies whether debug output is logged for this particular logger. Also can contain
  577. value trace, what is highest level of debug information.
  578. The default is off.
  579. .PP
  580. Within the
  581. .B logging
  582. directive, logger_subsys directives are optional.
  583. .PP
  584. Within the
  585. .B logger_subsys
  586. sub-directive, all of the above logging configuration options are valid and
  587. can be used to override the default settings.
  588. The subsys entry, described below, is mandatory to identify the subsystem.
  589. .TP
  590. subsys
  591. This specifies the subsystem identity (name) for which logging is specified. This is the
  592. name used by a service in the log_init() call. E.g. 'CPG'. This directive is
  593. required.
  594. .PP
  595. Within the
  596. .B quorum
  597. directive it is possible to specify the quorum algorithm to use with the
  598. .TP
  599. provider
  600. directive. At the time of writing only corosync_votequorum is supported.
  601. See votequorum(5) for configuration options.
  602. .PP
  603. Within the
  604. .B nodelist
  605. directive it is possible to specify specific information about nodes in cluster. Directive
  606. can contain only
  607. .B node
  608. sub-directive, which specifies every node that should be a member of the membership, and where
  609. non-default options are needed. Every node must have at least ring0_addr field filled.
  610. Every node that should be a member of the membership must be specified.
  611. Possible options are:
  612. .TP
  613. ringX_addr
  614. This specifies IP or network hostname address of the particular node.
  615. X is a link number.
  616. .TP
  617. nodeid
  618. This configuration option is required for each node for Kronosnet mode.
  619. It is a 32 bit value specifying the node identifier delivered to the
  620. cluster membership service. The node identifier value of zero is
  621. reserved and should not be used. If knet is set, this field must be set.
  622. .TP
  623. name
  624. This option is used mainly with knet transport to identify local node.
  625. It's also used by client software (pacemaker).
  626. Algorithm for identifying local node is following:
  627. .RS
  628. .IP 1.
  629. Looks up $HOSTNAME in the nodelist
  630. .IP 2.
  631. If this fails strip the domain name from $HOSTNAME and looks up
  632. that in the nodelist
  633. .IP 3.
  634. If this fails look in the nodelist for a fully-qualified name whose
  635. short version matches the short version of $HOSTNAME
  636. .IP 4.
  637. If all this fails then search the interfaces list for an address that
  638. matches a name in the nodelist
  639. .RE
  640. .PP
  641. Within the
  642. .B system
  643. directive it is possible to specify system options.
  644. Possible options are:
  645. .TP
  646. qb_ipc_type
  647. This specifies type of IPC to use. Can be one of native (default), shm and socket.
  648. Native means one of shm or socket, depending on what is supported by OS. On systems
  649. with support for both, SHM is selected. SHM is generally faster, but need to allocate
  650. ring buffer file in /dev/shm.
  651. .TP
  652. sched_rr
  653. Should be set to yes (default) if corosync should try to set round robin realtime
  654. scheduling with maximal priority to itself. When setting of scheduler fails, fallback to set
  655. maximal priority.
  656. .TP
  657. priority
  658. Set priority of corosync process. Valid only when sched_rr is set to no.
  659. Can be ether numeric value with similar meaning as
  660. .BR nice (1)
  661. or
  662. .B max
  663. /
  664. .B min
  665. meaning maximal / minimal priority (so minimal / maximal nice value).
  666. .TP
  667. move_to_root_cgroup
  668. Can be one of
  669. .B yes
  670. (Corosync always moves itself to root cgroup),
  671. .B no
  672. (Corosync never tries to move itself to root cgroup) or
  673. .B auto
  674. (Corosync first checks if sched_rr is enabled, and if
  675. so, it tries to set round robin realtime scheduling with maximal priority to itself.
  676. If setting of priority fails, corosync tries to move itself to root
  677. cgroup and retries setting of priority).
  678. This feature is available only for systems with cgroups v1 with RT
  679. sched enabled (Linux with CONFIG_RT_GROUP_SCHED kernel option) and cgroups v2.
  680. It's worth noting that currently (May 3 2021) cgroup2 doesn’t yet
  681. support control of realtime processes and the cpu controller can only be
  682. enabled when all RT processes are in the root cgroup (applies only for kernel
  683. with CONFIG_RT_GROUP_SCHED enabled). So when move_to_root_cgroup
  684. is disabled, kernel is compiled with CONFIG_RT_GROUP_SCHED and systemd is used,
  685. it may be impossible to make systemd options
  686. like CPUQuota working correctly until corosync is stopped.
  687. Also when moving to root cgroup is enforced and used together with cgroup2 and systemd
  688. it makes impossible (most of the time) for journald to add systemd specific
  689. metadata (most importantly _SYSTEMD_UNIT) properly, because corosync is
  690. moved out of cgroup created by systemd. This means
  691. it is not possible to filter corosync logged messages based on these metadata
  692. (for example using -u or _SYSTEMD_UNIT=UNIT pattern) and also running
  693. systemctl status doesn't display (all) corosync log messages.
  694. The problem is even worse because journald caches pid for some time
  695. (approx. 5 sec) so initial corosync messages have correct metadata.
  696. .TP
  697. allow_knet_handle_fallback
  698. If knet handle creation fails using privileged operations, allow fallback to
  699. creating knet handle using unprivileged operations. Defaults to no, meaning
  700. if privileged knet handle creation fails, corosync will refuse to start.
  701. The knet handle will always be created using privileged operations if possible,
  702. setting this to yes only allows fallback to unprivileged operations. This fallback
  703. may result in performance issues, but if running in an unprivileged environment,
  704. e.g. as a normal user or in unprivileged container, this may be required.
  705. .TP
  706. state_dir
  707. Existing directory where corosync should chdir into. Corosync stores
  708. important state files and blackboxes there.
  709. The default is /var/lib/corosync.
  710. .PP
  711. Within the
  712. .B resources
  713. directive it is possible to specify options for resources.
  714. Possible option is:
  715. .TP
  716. watchdog_device
  717. (Valid only if Corosync was compiled with watchdog support.)
  718. .br
  719. Watchdog device to use, for example /dev/watchdog.
  720. If unset, empty or "off", no watchdog is used.
  721. .IP
  722. In a cluster with properly configured power fencing a watchdog
  723. provides no additional value. On the other hand, slow watchdog
  724. communication may incur multi-second delays in the Corosync main loop,
  725. potentially breaking down membership. IPMI watchdogs are particularly
  726. notorious in this regard: read about kipmid_max_busy_us in IPMI.txt in
  727. the Linux kernel documentation.
  728. .PP
  729. Within the
  730. .B nozzle
  731. directive it is possible to specify options for a libnozzle device. This is a pseudo
  732. ethernet device that routes network traffic through a channel on the corosync knet network
  733. (NOT cpg or any corosync internal service) to other nodes in the cluster. This allows
  734. applications to take advantage of knet features such as multipathing, automatic failover,
  735. link switching etc. Note that libnozzle is not a reliable transport, but you can tunnel TCP
  736. through it for reliable communications.
  737. .br
  738. libnozzle also supports optional interface up/down scripts that are kept under a
  739. /etc/corosync/updown.d/ directory. See the knet documentation for more information.
  740. .br
  741. Only one nozzle device is allowed.
  742. .br
  743. The nozzle stanza takes several options:
  744. .TP
  745. name
  746. The name of the network device to be created. On Linux this may be any name at all, other
  747. platforms have restrictions on the name.
  748. .TP
  749. ipaddr
  750. The IP address (IPv6 or IPv4) of the interface. The bottom part of this address will be replaced
  751. by the local node's nodeid in conjunction with ipprefix. so, eg
  752. ipaddr: 192.168.1.0
  753. ipprefix: 24
  754. will make nodeids 1,2,5 use IP addresses 192.168.1.1, 192.168.1.2 & 192.168.1.5.
  755. If a prefix length of 16 is used then the bottom two bytes will be filled in with nodeid numbers.
  756. IPv6 addresses must end in '::', the nodeid will be added after the two colons to make the
  757. local IP address.
  758. Only one IP address is currently supported in the corosync.conf file. Additional IP addresses
  759. can be added in the ifup script if necessary.
  760. .TP
  761. ipprefix
  762. specifies the IP address prefix for the nozzle device (see above)
  763. .TP
  764. macaddr
  765. Specifies the MAC address prefix for the nozzle device. As for the IP address, the bottom part
  766. of the MAC address will be filled in with the node id. In this case no prefix applies, the bottom
  767. two bytes of the MAC address will always be overwritten with the node id. So specifying
  768. macaddr: 54:54:12:24:12:12 on nodeid 1 will result in it having a MAC address of 54:54:12:24:00:01
  769. .SH "TO ADD A NEW NODE TO THE CLUSTER"
  770. For example to add a node with address 10.24.38.108 with nodeid 3. The node has the name NEW
  771. (in DNS or /etc/hosts) and is not currently running corosync. The current corosync.conf nodelist
  772. looks like this:
  773. .PP
  774. .nf
  775. .RS
  776. nodelist {
  777. node {
  778. nodeid: 1
  779. ring0_addr: 10.24.38.101
  780. name: node1
  781. }
  782. node {
  783. nodeid: 2
  784. ring0_addr: 10.24.38.102
  785. name: node2
  786. }
  787. }
  788. .RE
  789. .fi
  790. .PP
  791. Add a new entry for the node below the existing nodes. Node entries don't have
  792. to be in nodeid order, but it will help keep you sane. So the nodelist now looks like this:
  793. .PP
  794. .nf
  795. .RS
  796. nodelist {
  797. node {
  798. nodeid: 1
  799. ring0_addr: 10.24.38.101
  800. name: node1
  801. }
  802. node {
  803. nodeid: 2
  804. ring0_addr: 10.24.38.102
  805. name: node2
  806. }
  807. node {
  808. nodeid: 3
  809. ring0_addr: 10.24.38.108
  810. name: NEW
  811. }
  812. }
  813. .RE
  814. .fi
  815. .PP
  816. .PP
  817. This file must then be copied onto all three nodes - the existing two nodes, and the new one.
  818. On one of the existing corosync nodes, tell corosync to re-read the updated config file into memory:
  819. .PP
  820. .nf
  821. .RS
  822. corosync-cfgtool -R
  823. .RE
  824. .fi
  825. .PP
  826. This command only needs to be run on one node in the cluster. You may then start corosync on the NEW node
  827. and it should join the cluster. If this doesn't work as expected then check the communications between all
  828. three nodes is working, and check the syslog files on all nodes for more information. It's important to note
  829. that the key bit of information about a node failing to join might be on a different node than you expect.
  830. .SH "TO REMOVE A NODE FROM THE CLUSTER"
  831. This is the reverse procedure to 'Adding a node' above. First you need to shut down the node you will
  832. be removing from the cluster.
  833. .PP
  834. .nf
  835. .RS
  836. corosync-cfgtool -H
  837. .RE
  838. .fi
  839. .PP
  840. Then delete the nodelist stanza from corosync.conf and finally update corosync on the remaining nodes by
  841. running
  842. .PP
  843. .nf
  844. .RS
  845. corosync-cfgtool -R
  846. .RE
  847. .fi
  848. .TP
  849. on one of them.
  850. .SH "ADDRESS RESOLUTION"
  851. corosync resolves ringX_addr names/IP addresses using the getaddrinfo(3) call with respect
  852. of totem.ip_version setting.
  853. getaddrinfo() function uses a sophisticated algorithm to sort node addresses into a preferred
  854. order and corosync always chooses the first address in that list of the required family.
  855. As such it is essential that your DNS or /etc/hosts files are correctly configured so that
  856. all addresses for ringX appear on the same network (or are reachable with minimal hops)
  857. and over the same IP protocol. If this is not the case then some nodes might not be able
  858. to join the cluster. It is possible to override the search order used
  859. by getaddrinfo() using the configuration file /etc/gai.conf(5) if necessary,
  860. but this is not recommended.
  861. If there is any doubt about the order of addresses returned from getaddrinfo() then it might be simpler to use
  862. IP addresses (v4 or v6) in the ringX_addr field.
  863. .SH "FILES"
  864. .TP
  865. /etc/corosync/corosync.conf
  866. The corosync executive configuration file.
  867. .SH "SEE ALSO"
  868. .BR corosync_overview (7),
  869. .BR votequorum (5),
  870. .BR corosync-qdevice (8),
  871. .BR logrotate (8)
  872. .BR getaddrinfo (3)
  873. .BR gai.conf (5)
  874. .PP