INSTALL 6.7 KB

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