INSTALL 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. ----------------------------------------------
  2. The Corosync Cluster Engine Installation Guide
  3. ----------------------------------------------
  4. Please read LICENSE for a description of the licensing of this software.
  5. All cryptographic software in this package is subject to the following legal
  6. notice:
  7. This package includes publicly available encryption source code which,
  8. together with object code resulting from the compiling of publicly
  9. available source code, may be exported from the United States under License
  10. Exception TSU prsuant to 15 C.F.R Section 740.13(e).
  11. ---------------------------------
  12. * Platforms Built and Tested On *
  13. ---------------------------------
  14. Corosync has been tested on:
  15. Linux: Fedora 11, Fedora 12 (rawhide), Debian Lenny, Debian Unstable,
  16. Ubuntu Hardy, Red Hat Enterprise Linux 5
  17. Solaris: version 10 CSW
  18. BSD: FreeBSD and OpenBSD
  19. MacOSX: Darwin latest update
  20. It should build and run properly on the tested platforms as well as possibly
  21. others with minimal effort. Corosync requires a coherent mmap() system call
  22. and will not operate on platforms which don't support coherent mmap().
  23. Corosync has been tested with recent gcc compilers and Intel's C compiler.
  24. SunStudio compilers fail to build with various internal compiler errors.
  25. ----------------------------
  26. * Building from subversion *
  27. ----------------------------
  28. When building and installing from subversion, automake 2.61 or later is
  29. required. Prior versions will result in build failures.
  30. Step 1: check out a read only copy of the repository
  31. svn checkout http://svn.fedoraprojects.org/svn/corosync
  32. Find the version you want to build. Usually this will be the "trunk" version
  33. located in the trunk directory. If you want to build a specific released
  34. version check in the tags directory.
  35. Step 2: Generate the makefiles
  36. balance:~/corosync/trunk% ./autogen.sh
  37. Step 3: Run the configure script
  38. balance:~/corosync/trunk% ./configure
  39. Step 4: Install the binaries
  40. balance:~/corosync/trunk% su
  41. balance:~/corosync/trunk# make install
  42. -------------------------
  43. * Building from tarball *
  44. -------------------------
  45. The tarball is distributed with pregenerated makefiles. There is no need
  46. to run the autogen.sh script in this case.
  47. Step 1: Run the configure script
  48. balance:~/corosync/trunk% ./configure
  49. Step 2: Install the binaries
  50. balance:~/corosync/trunk% su
  51. balance:~/corosync/trunk# make install
  52. -------------------------------
  53. * A notice about dependencies *
  54. -------------------------------
  55. We have strived very hard to avoid dependencies as much as possible, and in
  56. fact corosync can be compiled without any dependencies.
  57. Optional dependencies are support for NSS and support for Infiniband RDMA.
  58. NSS encryption performs more poorly then the default encryption, but may be
  59. a good choice if your organization has policies regarding encryption technology
  60. requiring the use of a common cryptographic library such as Netscape Security Services.
  61. To enable nss during building:
  62. balance:~/corosync/trunk% ./configure --enable-nss
  63. To disable nss during buildling:
  64. balance:~/corosync/trunk% ./configure --disable-nss
  65. The nss packages required to build corosync with nss support can usually be
  66. found by installing the "nss-devel" and "nspr-devel" packages for your
  67. distribution. Note nss is enabled by default, so if you don't want nss support
  68. or don't want to install nss devel packages, make sure to set the appropriate
  69. configure option as described above.
  70. -----------------------------------------
  71. * Building with Infiniband RDMA support *
  72. -----------------------------------------
  73. Infiniband RDMA build support is disabled by default. To enable rdma during
  74. building:
  75. balance:~/corosync/trunk% ./configure --enable-rdma
  76. Infiniband rdma support requires the libibverbs and librdmacm packages (and
  77. their -devel counterparts). Corosync requires the use of pkgconfig in these
  78. packages. The Corosync maintainers have sent patches for this feature upstream
  79. to the Infiniband maintainers.
  80. If your version of these packages don't have pkgconfig support, you will see an
  81. error during configure such as:
  82. checking for ibverbs... configure: error: Package requirements (ibverbs) were not met:
  83. No package 'ibverbs' found
  84. Consider adjusting the PKG_CONFIG_PATH environment variable if you
  85. installed software in a non-standard prefix.
  86. Alternatively, you may set the environment variables ibverbs_CFLAGS
  87. and ibverbs_LIBS to avoid the need to call pkg-config.
  88. See the pkg-config man page for more details.
  89. ** Follow the directions:
  90. balance:~/corosync/trunk% export ibverbs_CFLAGS=-I/usr/include/infiniband
  91. balance:~/corosync/trunk% export ibverbs_LIBS=-libverbs
  92. balance:~/corosync/trunk% export rdmacm_CFLAGS=-I/usr/include/rdma
  93. balance:~/corosync/trunk% export rdmacm_LIBS=-lrdmacm
  94. balance:~/corosync/trunk% ./configure --enable-rdma
  95. Hopefully pkgconfig support is added in your distribution's version of
  96. libibverbs and librdmacm soon if you run into this problem.
  97. -----------------------------------------
  98. * Building with SNMP/DBUS support *
  99. -----------------------------------------
  100. You can get SNMP traps on the following corosync events:
  101. 1) node joine/leave
  102. 2) application connect/dissconnect from corosync
  103. 3) quorum gain/lost
  104. There are 2 modes of achieving this DBUS + foghorn and snmp-agentx.
  105. Setting up to get dbus events.
  106. ------------------------------
  107. foghorn (http://git.fedorahosted.org/git/foghorn.git) converts
  108. dbus signals into snmp traps. So install foghorn.
  109. $ ./configure --enable-dbus
  110. $ make && sudo make install
  111. $ /etc/init.d/corosync start
  112. $ echo "OPTIONS=\"-d\"" > /etc/sysconfig/corosync-notifyd
  113. $ /etc/init.d/corosync-notifyd start
  114. Start foghorn
  115. to see the dbus signals getting sent try:
  116. $ dbus-monitor --system
  117. Setting up snmp-agentx.
  118. -----------------------
  119. If you don't want to use dbus then you can use snmp-agentx.
  120. $ ./configure --enable-snmp
  121. $ make && sudo make install
  122. $ /etc/init.d/corosync start
  123. $ vim /etc/snmp/snmptrapd.conf
  124. Add the following:
  125. authCommunity log,execute,net public
  126. $ /etc/init.d/snmptrapd start
  127. $ echo "OPTIONS=\"-s\"" > /etc/sysconfig/corosync-notifyd
  128. $ /etc/init.d/corosync-notifyd start
  129. I start up wireshark to see if there are any snmp traps been sent
  130. as I am too lazy to setup a manager to receive traps.
  131. run a program that talks to corosync e.g.
  132. $ corosync-objctl
  133. And you should get traps
  134. ------------------------
  135. * Configuring Corosync *
  136. ------------------------
  137. The corosync executive will automatically determine cluster membership by
  138. communicating on a specified multicast address and port.
  139. The directory conf contains the file corosync.conf.example
  140. # Please read the corosync.conf.5 manual page
  141. totem {
  142. version: 2
  143. secauth: off
  144. threads: 0
  145. interface {
  146. ringnumber: 0
  147. bindnetaddr: 192.168.1.1
  148. mcastaddr: 226.94.1.1
  149. mcastport: 5405
  150. }
  151. }
  152. logging {
  153. fileline: off
  154. to_stderr: yes
  155. to_file: yes
  156. to_syslog: yes
  157. logfile: /tmp/corosync.log
  158. debug: off
  159. timestamp: on
  160. }
  161. The totem section contains three values. All three values must be set
  162. or the corosync executive wll exit with an error.
  163. bindnetaddr specifies the address which the corosync Executive should bind to.
  164. This address should always end in zero. If the local interface taffic
  165. should routed over is 192.168.5.92, set bindnetaddr to 192.168.5.0.
  166. mcastaddr is a multicast address. The default should work but you may have
  167. a different network configuration. Avoid 224.x.x.x because this is a "config"
  168. multicast address.
  169. mcastport specifies the UDP port number. It is possible to use the same
  170. multicast address on a network with the corosync services configured for
  171. different UDP ports.
  172. The timeout section contains seven values. This section is not normally used,
  173. but rather used to override the program defaults for the purposes of fine
  174. tuning for a given networking/processor combination or for debugging purposes.
  175. Be careful to use the same timeout values on each of the nodes in the cluster
  176. or unpredictable results may occur.
  177. Do not use DOS style termination. This breaks the parser.
  178. Generate a private key
  179. ----------------------
  180. corosync uses cryptographic techniques to ensure authenticity and privacy of
  181. messages. A private key must be generated and shared by all processors for
  182. correct operation.
  183. First generate the key on one of the nodes:
  184. balance# corosync-keygen
  185. Corosync Authentication key generator.
  186. Gathering 1024 bits for key from /dev/random.
  187. Writing corosync key to /etc/ais/authkey.
  188. After this is complete, a private key will be in the file /etc/ais/authkey.
  189. This private key must be copied to every processor that will be a member of
  190. the cluster. If the private key isn't the same for every node, those nodes
  191. with nonmatching private keys will not be able to join the same configuration.
  192. Copy the key to some transportable storage or use ssh to transmit the key
  193. from node to node. Then install the key with the command:
  194. balance# install -D --group=0 --owner=0 --mode=0400 /path_to_authkey/authkey /etc/ais/authkey
  195. If the message invalid digest appears, the keys are not the same on each node.
  196. Run the corosync executive
  197. -------------------------
  198. Get one or more nodes and run the corosync executive on each node. Run the
  199. corosync daemon after following the previous directions. The daemon must be
  200. run as UID 0(root).
  201. please read SECURITY to understand the threat model assumed by corosync
  202. and the techniques corosync use to overcome these threats.
  203. Before running any of the test programs
  204. ---------------------------------------
  205. The corosync executive will ensure security by only allowing the UID 0(root) or
  206. GID 0(root) to connect to it. To allow other users to access the corosync
  207. executive, create a directory called /etc/corosync/uidgid.d and place a file in
  208. it named in some way that is identifiable to you. All files in this directory
  209. will be scanned and their contents added to the allowed uid gid database. The
  210. contents of this file should be
  211. uidgid {
  212. uid: username
  213. gid: groupname
  214. }
  215. Please note that these users then have full ability to transmit and receive
  216. messages in the cluster and are not bound by the threat model described in
  217. SECURITY.
  218. Try out the corosync cpg functionality
  219. --------------------------------------
  220. After corosync is running
  221. Run test/testcpg on multiple nodes or on the same node. Messages can be typed
  222. which will then be sent to other testcpg applications in the cluster.
  223. To see a hashed verified output of data on all nodes, test/cpgverify can be
  224. run.