QUICKSTART 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. Application Interface Specification Quckstart Guide
  2. ---------------------------------------------------
  3. ***
  4. All cryptographic software in this package is subject to the following legal
  5. notice:
  6. This package includes publicly available encryption source code which,
  7. together with object code resulting from the compiling of publicly
  8. available source code, may be exported from the United States under License
  9. Exception TSU prsuant to 15 C.F.R Section 740.13(e).
  10. ***
  11. This openais package is broken into four parts. The exec directory contains
  12. all of the code responsible for serving the APIs. The api directory contains
  13. APIs the user can link to. The test directory contains some simple test
  14. programs which exercise the APIs. The directory conf contains example
  15. configuration files which can be copied directly onto the target system.
  16. The API implements the Cluster Membership (CLM), Availabilty Management
  17. Framework (AMF) and the Checkpointing (CKPT) APIs.
  18. Configuring the openais executive:
  19. ------------------------------
  20. The openais executive will automatically determine cluster membership by
  21. communicating on a specified multicast address and port.
  22. The directory conf contains the file openais.conf
  23. network {
  24. bindnetaddr: 192.168.1.0
  25. mcastaddr: 226.94.1.1
  26. mcastport: 5405
  27. }
  28. logging {
  29. logoutput: file
  30. logoutput: stderr
  31. logoutput: syslog
  32. logfile: /tmp/ais
  33. debug: on
  34. timestamp: on
  35. }
  36. The network section contains three values. All three values must be set
  37. or the openais executive wll exit with an error.
  38. bindnetaddr specifies the address which the openais Executive should bind to.
  39. This address should always end in zero. If the local interface taffic
  40. should routed over is 192.168.5.92, set bindnetaddr to 192.168.5.0.
  41. mcastaddr is a multicast address. The default should work but you may have
  42. a different network configuration. Avoid 224.x.x.x because this is a "config"
  43. multicast address.
  44. mcastport specifies the UDP port number. It is possible to use the same
  45. multicast address on a network with the openais services configured for different
  46. UDP ports.
  47. The logging section contains values. These values do not have to be set in which
  48. case the system defaults to logging to syslog and stderr with timestamping and debug.
  49. It is possible to select 3 destinations for logs: files, stderr, and syslog. One or
  50. more may be selected at the same time. If file is selected as a destination, the file
  51. name must be specified via the logfile option or the openais executive will exit.
  52. The debug option prints out internal debugging information during runtime which may
  53. be helpful for developers.
  54. The timestamp option prints the date and time on each log message.
  55. The directory conf contains the file groups.conf which specifies the failover
  56. groups, service units, components, and policies to be used by the AMF. The
  57. configuration file matches the testamf1-6 programs in the test directory and
  58. can be copied directly.
  59. These two files should be placed in the /etc/ais directory.
  60. Building openais
  61. ----------------
  62. openais requires GCC, LD, and a Linux 2.4 kernel. openais has been tested on
  63. Debian Sarge, MontaVista Carrier Grade Edition 3.1, and Redhat 9, and Fedora
  64. Core 2.
  65. Compile openais by running make in the root directory. Make can also be run
  66. in the individual directories. Nothing is installed by make. If install
  67. is desired, the files must be copied manually.
  68. Confiugre Host
  69. --------------
  70. For security reasons, the openais only allows a process that had the EGID/GID
  71. of "ais" to connect to it. To make development easier, it is recommended to
  72. create an "ais" user with the "ais" group.
  73. [root@slickdeal root]# adduser ais -g ais
  74. Set the ais user's password to something you can remember:
  75. [root@slickdeal root]# passwd ais
  76. Changing password for user ais.
  77. New password:
  78. Retype new password:
  79. passwd: all authentication tokens updated successfully.
  80. Configure Network
  81. -----------------
  82. Some networks do not automatically configure the default route. Ensure
  83. the default route is configured or openais wont be able to communicate with
  84. other nodes.
  85. [sdake@slickdeal sdake]$ /sbin/route
  86. Kernel IP routing table
  87. Destination Gateway Genmask Flags Metric Ref Use Iface
  88. 10.0.0.6 * 255.255.255.255 UH 0 0 0 tun0
  89. 127.0.0.0 * 255.0.0.0 U 0 0 0 lo
  90. default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
  91. the word default above specifies the default route. If the default route
  92. is missing, specify one by
  93. unix# /sbin/route add default gw 192.168.1.1
  94. where 192.168.1.1 is the gateway. It is possible to specify an invalid
  95. route which will also make openais work properly.
  96. Generate a private key
  97. ----------------------
  98. openais uses cryptographic techniques to ensure authenticity and privacy of
  99. messages. In order for openais to work, a private key must be generated and
  100. shared to all processors.
  101. First generate the key on one of the nodes:
  102. unix# exec/keygen
  103. Openopenais Authentication key generator.
  104. Gathering 1024 bits for key from /dev/random.
  105. Writing openais key to /etc/ais/authkey.
  106. After this is complete, a private key will be in the directory /etc/ais/authkey.
  107. This private key must be copied to every processor that will be a member of
  108. the cluster. If the private key isn't the same for every node, those nodes
  109. with nonmatching private keys will not be able to join the same configuration.
  110. Copy the key to some transportable storage or use ssh to transmit the key
  111. from node to node. Then install the key with the command:
  112. unix# install -D --group=0 --owner=0 --mode=0400 /path_to_authkey/authkey /etc/ais/authkey
  113. If the message invalid digest appears, the keys are not the same on each node.
  114. Run the openais executive
  115. -------------------------
  116. Get one or more nodes and run the openais executive on each node. A list of
  117. node IPs should be logged when the nodes join a configuration. Run the
  118. aisexec program after following the previous directions.
  119. Before running any of the test programs
  120. ---------------------------------------
  121. The openais executive will ensure security by only allowing the ais group (or
  122. uid root) to connect to the service. Switch to the ais group before
  123. running any applications linked to the saf api, or the applications will
  124. not be authenticated and won't be able to access services.
  125. [sdake@slickdeal sdake]$ su ais
  126. Password:
  127. [ais@slickdeal sdake]$ id
  128. uid=501(ais) gid=502(ais) groups=502(ais)
  129. Try out the openais CLM functionality
  130. ---------------------------------
  131. After aisexec is running
  132. su to ais user
  133. Run test/testclm on one node. Then kill and add nodes. This will cause
  134. callbacks to be called in the testclm application which will print out
  135. the node state changes. The testclm program will not print any output
  136. after it is started and has printed the current configuration until nodes
  137. are added to or deleted from the configuration by starting and stopping
  138. aisexec on other nodes.
  139. Killing aisexec on the node the testclm is connected will cause the
  140. API to return error codes indicating the system has failed.
  141. Try out the openais AMF functionality
  142. ---------------------------------
  143. After aisexec is running
  144. su to ais user
  145. The test/testamf{1-6} implement three seperate service units (SU). SU #1
  146. consists of testamf1, testamf2. SU #2 consists of testamf3, testamf4.
  147. SU #3 consists of testamf5, testamf6. The active and backup directives
  148. in groups.conf define how many SU's become active and how many
  149. become standby in the service group (SG).
  150. To test the openais AMF, run testamf3 and testamf4 on one node. Both
  151. components become in service and active. Then run testamf1. Nothing
  152. appears to happen, because testamf1 is not placed in service (and made
  153. standby) until testamf2 is registered. Running testamf2 will show
  154. a variety of state changes. testamf1 will match these state changes.
  155. testamf2 is special because is reports an error, and later cancels
  156. the error, causing the entire SU to go out of service, then back in
  157. service. This behavior is expected by the openais specification and the
  158. code in testamf2.c can be read for a clearer understanding of what
  159. is happening.
  160. Pressing ctrl-z to background the task (which causes the heartbeat to
  161. timeout) on a component will cause the remaining component to go
  162. out of service. If ctrl-z is pressed on the active SU, the standby
  163. SU will become active. CTRL-C on these tests behaves the same way.
  164. A crash behaves the same way.
  165. Try out the openais CKPT functionality
  166. --------------------------------------
  167. su to ais user
  168. run testckpt. This will execute various checkpoint API operations.
  169. run ckptbench. This will execute non-threaded write benchmarks.
  170. run ckptbenchth. This will execute threaded write benchmarks.
  171. The benchmark configuration (how many threads to run, how many writes
  172. per benchmark run, and data write size are specified in the ckptbench.c
  173. and ckptbenchth.c programs.
  174. Two node clusters should approach 8.5 MB/sec on 100 mbit networks for
  175. larger checkpoint sizes with encryption and authentication. If you are not
  176. seeing these results, please report to the mailing list.
  177. Write your own applications
  178. ---------------------------
  179. Without real applications, finding the hard bugs will be difficult. Please
  180. port or write apps and let us know of the progress!
  181. Contribute!
  182. -----------
  183. Code, examples, documentation, bug reports, testing are all appreciated.
  184. Read the TODO or the ask on the mailing lists for ways to contribute.