INSTALL 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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 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 SNMP/DBUS support *
  43. -----------------------------------------
  44. You can get SNMP traps on the following corosync events:
  45. 1) node joine/leave
  46. 2) application connect/dissconnect from corosync
  47. 3) quorum gain/lost
  48. There are 2 modes of achieving this DBUS + foghorn and snmp-agentx.
  49. Setting up to get dbus events.
  50. ------------------------------
  51. foghorn (http://git.fedorahosted.org/git/foghorn.git) converts
  52. dbus signals into snmp traps. So install foghorn.
  53. $ ./configure --enable-dbus
  54. $ make && sudo make install
  55. $ /etc/init.d/corosync start
  56. $ echo "OPTIONS=\"-d\"" > /etc/sysconfig/corosync-notifyd
  57. $ /etc/init.d/corosync-notifyd start
  58. Start foghorn
  59. to see the dbus signals getting sent try:
  60. $ dbus-monitor --system
  61. Setting up snmp-agentx.
  62. -----------------------
  63. If you don't want to use dbus then you can use snmp-agentx.
  64. $ ./configure --enable-snmp
  65. $ make && sudo make install
  66. $ /etc/init.d/corosync start
  67. $ vim /etc/snmp/snmptrapd.conf
  68. Add the following:
  69. authCommunity log,execute,net public
  70. $ /etc/init.d/snmptrapd start
  71. $ echo "OPTIONS=\"-s\"" > /etc/sysconfig/corosync-notifyd
  72. $ /etc/init.d/corosync-notifyd start
  73. I start up wireshark to see if there are any snmp traps been sent
  74. as I am too lazy to setup a manager to receive traps.
  75. run a program that talks to corosync e.g.
  76. $ corosync-cmapctl
  77. And you should get traps
  78. ------------------------
  79. * Configuring Corosync *
  80. ------------------------
  81. The corosync executive will automatically determine cluster membership by
  82. communicating on a specified multicast address and port.
  83. The directory conf contains the file corosync.conf.example
  84. # Please read the corosync.conf.5 manual page
  85. totem {
  86. version: 2
  87. secauth: off
  88. threads: 0
  89. interface {
  90. ringnumber: 0
  91. bindnetaddr: 192.168.1.1
  92. mcastaddr: 226.94.1.1
  93. mcastport: 5405
  94. }
  95. }
  96. logging {
  97. fileline: off
  98. to_stderr: yes
  99. to_file: yes
  100. to_syslog: yes
  101. logfile: /tmp/corosync.log
  102. debug: off
  103. timestamp: on
  104. }
  105. The totem section contains three values. All three values must be set
  106. or the corosync executive wll exit with an error.
  107. bindnetaddr specifies the address which the corosync Executive should bind to.
  108. This address should always end in zero. If the local interface taffic
  109. should routed over is 192.168.5.92, set bindnetaddr to 192.168.5.0.
  110. mcastaddr is a multicast address. The default should work but you may have
  111. a different network configuration. Avoid 224.x.x.x because this is a "config"
  112. multicast address.
  113. mcastport specifies the UDP port number. It is possible to use the same
  114. multicast address on a network with the corosync services configured for
  115. different UDP ports.
  116. The timeout section contains seven values. This section is not normally used,
  117. but rather used to override the program defaults for the purposes of fine
  118. tuning for a given networking/processor combination or for debugging purposes.
  119. Be careful to use the same timeout values on each of the nodes in the cluster
  120. or unpredictable results may occur.
  121. Generate a private key
  122. ----------------------
  123. corosync uses cryptographic techniques to ensure authenticity and privacy of
  124. messages. A private key must be generated and shared by all processors for
  125. correct operation.
  126. First generate the key on one of the nodes:
  127. balance# corosync-keygen
  128. Corosync Authentication key generator.
  129. Gathering 1024 bits for key from /dev/random.
  130. Writing corosync key to /etc/corosync/authkey.
  131. After this is complete, a private key will be in the file /etc/corosync/authkey.
  132. This private key must be copied to every processor that will be a member of
  133. the cluster. If the private key isn't the same for every node, those nodes
  134. with nonmatching private keys will not be able to join the same configuration.
  135. Copy the key to some transportable storage or use ssh to transmit the key
  136. from node to node. Then install the key with the command:
  137. balance# install -D --group=0 --owner=0 --mode=0400 /path_to_authkey/authkey /etc/corosync/authkey
  138. If the message invalid digest appears, the keys are not the same on each node.
  139. Run the corosync executive
  140. -------------------------
  141. Get one or more nodes and run the corosync executive on each node. Run the
  142. corosync daemon after following the previous directions. The daemon must be
  143. run as UID 0(root).
  144. Before running any of the test programs
  145. ---------------------------------------
  146. The corosync executive will ensure security by only allowing the UID 0(root) or
  147. GID 0(root) to connect to it. To allow other users to access the corosync
  148. executive, create a directory called /etc/corosync/uidgid.d and place a file in
  149. it named in some way that is identifiable to you. All files in this directory
  150. will be scanned and their contents added to the allowed uid gid database. The
  151. contents of this file should be
  152. uidgid {
  153. uid: username
  154. gid: groupname
  155. }
  156. Please note that these users then have full ability to transmit and receive
  157. messages in the cluster.
  158. Try out the corosync cpg functionality
  159. --------------------------------------
  160. After corosync is running
  161. Run test/testcpg on multiple nodes or on the same node. Messages can be typed
  162. which will then be sent to other testcpg applications in the cluster.
  163. To see a hashed verified output of data on all nodes, test/cpgverify can be
  164. run.