corosync_overview.8 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. .\"/*
  2. .\" * Copyright (c) 2005 MontaVista Software, Inc.
  3. .\" * Copyright (c) 2006 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_OVERVIEW 8 2006-05-10 "corosync Man Page" "Corosync Cluster Engine Programmer's Manual"
  36. .SH OVERVIEW
  37. The corosync project is a project to implement a production quality "Revised BSD"
  38. licensed implementation of the most recent SA Forum's Application Interface
  39. Specification. The Application Interface Specification is a software API and
  40. policies which are used to develop applications that maintain service during
  41. faults. The API consists of Availability Management Framework (AMF) which
  42. provides application failover, Cluster Membership (CLM), Checkpointing (CKPT),
  43. Eventing (EVT), Messaging (MSG), and Distributed Locking (DLOCK).
  44. Currently Messaging is unimplemented.
  45. Faults occur for various reasons:
  46. .PP
  47. * Application Faults
  48. .PP
  49. * Middleware Faults
  50. .PP
  51. * Operating System Faults
  52. .PP
  53. * Hardware Faults
  54. The major focus of high availability in the past has been to mask hardware
  55. faults. Faults in other components of the system have gone unsolved until
  56. AIS. AIS can mask many types of faults in applications, middleware,
  57. operating systems, or even hardware by providing a simple framework
  58. for allowing developers to create redundant applications. These redundant
  59. applications can be distributed over multiple nodes such that if any one
  60. node faults, another node can recover.
  61. Application programmers develop applications to periodically record their
  62. state using the checkpointing service. When an active application fails,
  63. a standby application recovers the state of the application. This
  64. technique, called stateful application failover, provides the fundamental
  65. difference between corosync and other systems that have come before it.
  66. With stateful application failover, the end-application user doesn't
  67. have to reload the application or redial a telephone. The full state
  68. is recorded, so the end-application user sees no interruption in service.
  69. Because programmers can now distribute applications across multiple
  70. processes or nodes, a mechanism must exist for them to communicate.
  71. This mechanism is provided by two services. The event service provides
  72. a publish/subscribe model for events. The messaging service provides
  73. end to end messaging. Finally a mechanism to synchronize access is
  74. provided by the distributed lock service.
  75. The corosync project also provides a group messaging toolkit called EVS.
  76. The EVS service implements a messaging model known as Extended Virtual
  77. Synchrony. This model allows one sender to transmit to many receivers.
  78. Certain guarantees are provided for message and membership delivery
  79. which make virtual synchrony ideal for developing distributed applications.
  80. .SH QUICKSTART
  81. The corosync executive must be configured. In the directory conf in the
  82. source distribution are several files that must be copied to the /etc/ais
  83. directory. If corosync is packaged by a distro, this may be complete.
  84. The directory contains the file corosync.conf. Please read the corosync.conf(5)
  85. man page for details on the configuration options. The corosync project will
  86. work out of the box with the default configuration options, although the
  87. administrator may desire different options.
  88. An user and group of the name "ais" must be added to the system. If corosync
  89. is packaged from a distro, this step should already be completed.
  90. This can be achieved by executing:
  91. [root@slickdeal root]# adduser ais -g ais
  92. The corosync executive uses cryptographic techniques to ensure authenticity
  93. and privacy of the messages. In order for corosync to be secure and operate,
  94. a private key must be generated and shared to all processors.
  95. First generate the key on one of the nodes:
  96. unix# ais-keygen
  97. corosync authentication key generator.
  98. .PP
  99. Gathering 1024 bits for key from /dev/random.
  100. .PP
  101. Writing corosync key to /etc/ais/authkey.
  102. .PP
  103. After this operation, a private key will be in the file /etc/ais/authkey.
  104. This private key must be copied to every processor in the cluster. If the
  105. private key isn't the same for every node, those nodes with nonmatching private
  106. keys will not be able to join the same configuration.
  107. Copy the key to some security transportable storage or use ssh to transmit the
  108. key from node to node. Then install the key with the command:
  109. unix#: install -D --group=0 --owner=0 --mode=0400 /path_to_authkey/authkey /etc/ais/authkey
  110. If a message "Invalid digest" appears from the corosync executive, the keys
  111. are not consistent between processors.
  112. Finally run the corosync executive. If corosync is packaged from a distro, it
  113. may be set to start on system start. It may also be turned off by default in
  114. which case the init script for corosync must be enabled.
  115. After running aisexec, a list of all processors IP addresses running the ais
  116. executive and configured on the same multicast address will appear. If they
  117. don't appear, there may be a problem with multicast in the distro or hardware.
  118. If this happens, participation in the corosync mailing list may help solve the
  119. problem. The email address is corosync@lists.osdl.org.
  120. .SH USING LIBRARIES
  121. The corosync AIS libraries have header files which must be included in the
  122. developer's application. Once the header file is included, the developer can
  123. reference the AIS interfaces.
  124. The corosync project recommends to distros to place include files in
  125. /usr/include/corosync. The following include lines must be added to
  126. the application to use each of the following services:
  127. #include <corosync/saClm.h> For the Cluster Membership B.01.01 service.
  128. .PP
  129. #include <corosync/saCkpt.h> For the Checkpointing B.01.01 service.
  130. .PP
  131. #include <corosync/saEvt.h> For the Eventing B.01.01 service.
  132. .PP
  133. #include <corosync/ais_amf.h> For the AMF A.01.01 service.
  134. .PP
  135. The corosync project recommends to distros to place library files in
  136. /usr/lib. The following link lines must be added to the LDFLAGS section
  137. of the makefile.
  138. -lsaClm For the Cluster Membership B.01.01 service
  139. .PP
  140. -lsaCkpt For the Checkpointing B.01.01 service
  141. .PP
  142. -lsaEvt For the Eventing B.01.01 service
  143. .PP
  144. -lsaAmf For the AMF A.01.01 service
  145. .PP
  146. -lais Specify this to get access to all AIS libraries without specifying
  147. each library individually.
  148. .SH IPv6
  149. The corosync project supports both IPv4 and IPv6 network addresses. The entire
  150. cluster must use either IPv4 or IPv6 for the cluster communication mechanism.
  151. In order to use IPv6, IPv6 addresses must be specified in the bindnetaddr and
  152. mcastaddr fields in the configuration file. The nodeid field must also be
  153. set.
  154. An example of this is:
  155. nodeid: 2
  156. bindnetaddr: fec0::1:a800:4ff:fe00:20
  157. mcastaddr: ff05::1
  158. To configure a host for IPv6, use the ifconfig program to add interfaces:
  159. box20: ifconfig eth0 add fec0::1:a800:4ff:fe00:20/64
  160. box30: ifconfig eth0 add fec0::1:a800:4ff:fe00:30/64
  161. If the /64 is not specified, a route for the IPv6 network will not be configured
  162. which will cause significant problems. Make sure a route is available for
  163. IPv6 traffic.
  164. .SH ARCHITECTURE
  165. The AIS libraries are a thin IPC interface to the corosync executive. The
  166. corosync executive provides services for the SA Forum AIS libraries as well
  167. as the EVS and CPG libraries.
  168. The corosync executive uses the Totem extended virtual synchrony protocol. The
  169. advantage to the end user is excellent performance characteristics and a proven
  170. protocol with excellent reliability. This protocol connects the processors
  171. in a configuration together so they may communicate.
  172. .SH ENVIRONMENT VARIABLES
  173. The corosync executive process uses four environment variables during startup.
  174. If these environment variables are not set, defaults will be used.
  175. .TP
  176. COROSYNC_MAIN_CONFIG_FILE
  177. This specifies the fully qualified path to the corosync configuration file.
  178. The default is /etc/ais/corosync.conf.
  179. .TP
  180. COROSYNC_AMF_CONFIG_FILE
  181. This specifies the fully qualified path to the corosync Availability Management
  182. Framework configuration file.
  183. The default is /etc/ais/amf.conf.
  184. .TP
  185. COROSYNC_DEFAULT_CONFIG_IFACE
  186. This specifies the LCRSO that is used to parse the configuration file. This
  187. allows other configuration file parsers to be implemented within the system.
  188. The default is to use the default corosync configuration file parser which
  189. parses the format specified in corosync.conf (5).
  190. .TP
  191. COROSYNC_TOTEM_AUTHKEY_FILE
  192. This specifies the fully qualified path to the shared key used to
  193. authenticate and encrypt data used within the Totem protocol.
  194. The default is /etc/ais/authkey.
  195. .SH SECURITY
  196. The corosync executive optionally encrypts all messages sent over the network
  197. using the SOBER-128 stream cipher. The corosync executive uses HMAC and SHA1 to
  198. authenticate all messages. The corosync executive library uses SOBER-128
  199. as a pseudo random number generator. The EVS library feeds the PRNG using
  200. the /dev/random Linux device.
  201. If membership messages can be captured by intruders, it is possible to execute
  202. a denial of service attack on the cluster. In this scenario, the cluster is
  203. likely already compromised and a DOS attack is the least of the administration's
  204. worries.
  205. The security in corosync does not offer perfect forward secrecy because the keys
  206. are reused. It may be possible for an intruder by capturing packets in an
  207. automated fashion to determine the shared key. No such automated attack has
  208. been published as of yet. In this scenario, the cluster is likely already
  209. compromised to allow the long-term capture of transmitted data.
  210. For security reasons, the corosync executive binary aisexec should NEVER
  211. be setuid or setgid in the filesystem.
  212. .PP
  213. .SH SAFTEST COMPLIANCE
  214. The corosync libraries are now nearly compliant with every aspect of the SA
  215. Forum's AIS specification. The AMF service, however, is not compliant with the
  216. B.01.01 specification. The remaining services pass most of the tests of the
  217. saftest suite against the B.01.01 specification.
  218. .SH BUGS
  219. The messaging service is partially implemented and not suitable for deployment.
  220. The distributed locking service is buggy and not suitable for deployment.
  221. The Availability Management Framework is under development and not suitable for
  222. deployment..
  223. .SH "SEE ALSO"
  224. .BR corosync.conf (5),
  225. .BR evs_overview (8)
  226. .PP