INSTALL 8.6 KB

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