INSTALL 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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 (https://github.com/ClusterLabs/libqb)
  37. and KNET (https://kronosnet.org/).
  38. Optional dependencies are support for DBUS, SNMP and libstatgrab.
  39. Also don't forget to install pkgconfig.
  40. -----------------------------------------
  41. * Building with SNMP/DBUS support *
  42. -----------------------------------------
  43. You can get SNMP traps on the following corosync events:
  44. 1) node joine/leave
  45. 2) application connect/dissconnect from corosync
  46. 3) quorum gain/lost
  47. There are 2 modes of achieving this DBUS + foghorn and snmp-agentx.
  48. Setting up to get dbus events.
  49. ------------------------------
  50. foghorn (http://git.fedorahosted.org/git/foghorn.git) converts
  51. dbus signals into snmp traps. So install foghorn.
  52. $ ./configure --enable-dbus
  53. $ make && sudo make install
  54. $ /etc/init.d/corosync start
  55. $ echo "OPTIONS=\"-d\"" > /etc/sysconfig/corosync-notifyd
  56. $ /etc/init.d/corosync-notifyd start
  57. Start foghorn
  58. to see the dbus signals getting sent try:
  59. $ dbus-monitor --system
  60. Setting up snmp-agentx.
  61. -----------------------
  62. If you don't want to use dbus then you can use snmp-agentx.
  63. $ ./configure --enable-snmp
  64. $ make && sudo make install
  65. $ /etc/init.d/corosync start
  66. $ vim /etc/snmp/snmptrapd.conf
  67. Add the following:
  68. authCommunity log,execute,net public
  69. $ /etc/init.d/snmptrapd start
  70. $ echo "OPTIONS=\"-s\"" > /etc/sysconfig/corosync-notifyd
  71. $ /etc/init.d/corosync-notifyd start
  72. I start up wireshark to see if there are any snmp traps been sent
  73. as I am too lazy to setup a manager to receive traps.
  74. run a program that talks to corosync e.g.
  75. $ corosync-cmapctl
  76. And you should get traps
  77. ------------------------
  78. * Configuring Corosync *
  79. ------------------------
  80. The configuration directory (usually /etc/corosync) contains an example
  81. configuration file (corosync.conf.example). Please copy it as corosync.conf
  82. and edit it as needed. At the very minimum, the nodelist section will have to be changed
  83. to list all cluster nodes. For more information about the configuration file
  84. please read the corosync.conf.5 manual page.
  85. Generate a private key
  86. ----------------------
  87. corosync uses cryptographic techniques to ensure authenticity and privacy of
  88. messages. A private key must be generated and shared by all processors for
  89. correct operation.
  90. First generate the key on one of the nodes:
  91. balance# corosync-keygen
  92. Corosync Authentication key generator.
  93. Gathering 8192 bits for key from /dev/random.
  94. Writing corosync key to /etc/corosync/authkey.
  95. After this is complete, a private key will be in the file /etc/corosync/authkey.
  96. This private key must be copied to every processor that will be a member of
  97. the cluster. If the private key isn't the same for every node, those nodes
  98. with nonmatching private keys will not be able to join the same configuration.
  99. Copy the key to some transportable storage or use ssh to transmit the key
  100. from node to node. Then install the key with the command:
  101. balance# install -D --group=0 --owner=0 --mode=0400 /path_to_authkey/authkey /etc/corosync/authkey
  102. If the message invalid digest appears, the keys are not the same on each node.
  103. Run the corosync executive
  104. -------------------------
  105. Get one or more nodes and run the corosync executive on each node. Run the
  106. corosync daemon after following the previous directions. The daemon must be
  107. run as UID 0(root).
  108. Before running any of the test programs
  109. ---------------------------------------
  110. The corosync executive will ensure security by only allowing the UID 0(root) or
  111. GID 0(root) to connect to it. To allow other users to access the corosync
  112. executive, create a directory called /etc/corosync/uidgid.d and place a file in
  113. it named in some way that is identifiable to you. All files in this directory
  114. will be scanned and their contents added to the allowed uid gid database. The
  115. contents of this file should be
  116. uidgid {
  117. uid: username
  118. gid: groupname
  119. }
  120. Please note that these users then have full ability to transmit and receive
  121. messages in the cluster.
  122. Try out the corosync cpg functionality
  123. --------------------------------------
  124. After corosync is running
  125. Run test/testcpg on multiple nodes or on the same node. Messages can be typed
  126. which will then be sent to other testcpg applications in the cluster.
  127. To see a hashed verified output of data on all nodes, test/cpgverify can be
  128. run.