QUICKSTART 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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 lib 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 SA Forum APIs for Cluster Membership (CLM), Availabilty
  17. Management Framework (AMF), Checkpointing (CKPT), and Eventing (EVT).
  18. The API also contains an extended virtual synchrony API which can be used
  19. in distributed applications.
  20. Configuring the openais executive:
  21. ---------------------------------
  22. The openais executive will automatically determine cluster membership by
  23. communicating on a specified multicast address and port.
  24. The directory conf contains the file openais.conf
  25. network {
  26. bindnetaddr: 192.168.1.0
  27. mcastaddr: 226.94.1.1
  28. mcastport: 5405
  29. }
  30. logging {
  31. logoutput: file
  32. logoutput: stderr
  33. logoutput: syslog
  34. logfile: /tmp/ais
  35. debug: on
  36. timestamp: on
  37. }
  38. The network section contains three values. All three values must be set
  39. or the openais executive wll exit with an error.
  40. bindnetaddr specifies the address which the openais Executive should bind to.
  41. This address should always end in zero. If the local interface taffic
  42. should routed over is 192.168.5.92, set bindnetaddr to 192.168.5.0.
  43. mcastaddr is a multicast address. The default should work but you may have
  44. a different network configuration. Avoid 224.x.x.x because this is a "config"
  45. multicast address.
  46. mcastport specifies the UDP port number. It is possible to use the same
  47. multicast address on a network with the openais services configured for different
  48. UDP ports.
  49. The logging section contains values. These values do not have to be set in which
  50. case the system defaults to logging to syslog and stderr with timestamping and debug.
  51. It is possible to select 3 destinations for logs: files, stderr, and syslog. One or
  52. more may be selected at the same time. If file is selected as a destination, the file
  53. name must be specified via the logfile option or the openais executive will exit.
  54. The debug option prints out internal debugging information during runtime which may
  55. be helpful for developers.
  56. The timestamp option prints the date and time on each log message.
  57. The directory conf contains the file groups.conf which specifies the failover
  58. groups, service units, components, and policies to be used by the AMF. The
  59. configuration file matches the testamf1-6 programs in the test directory and
  60. can be copied directly.
  61. These two files should be placed in the /etc/ais directory.
  62. Building openais
  63. ----------------
  64. openais requires GCC, LD, and a Linux 2.4/2.6 kernel. openais has been tested on
  65. Debian Sarge, MontaVista Carrier Grade Edition 3.1, and Redhat 9, and Fedora
  66. Core 2.
  67. Compile openais by running make in the root directory. Make can also be run
  68. in the individual directories. Nothing is installed by make. If install
  69. is desired, the files must be copied manually.
  70. Configure Host
  71. --------------
  72. For security reasons, the openais only allows a process that had the EGID/GID
  73. of "ais" to connect to it. To make development easier, it is recommended to
  74. create an "ais" user with the "ais" group.
  75. [root@slickdeal root]# adduser ais -g ais
  76. Set the ais user's password to something you can remember:
  77. [root@slickdeal root]# passwd ais
  78. Changing password for user ais.
  79. New password:
  80. Retype new password:
  81. passwd: all authentication tokens updated successfully.
  82. Generate a private key
  83. ----------------------
  84. openais uses cryptographic techniques to ensure authenticity and privacy of
  85. messages. In order for openais to work, a private key must be generated and
  86. shared to all processors.
  87. First generate the key on one of the nodes:
  88. unix# exec/keygen
  89. Openopenais Authentication key generator.
  90. Gathering 1024 bits for key from /dev/random.
  91. Writing openais key to /etc/ais/authkey.
  92. After this is complete, a private key will be in the directory /etc/ais/authkey.
  93. This private key must be copied to every processor that will be a member of
  94. the cluster. If the private key isn't the same for every node, those nodes
  95. with nonmatching private keys will not be able to join the same configuration.
  96. Copy the key to some transportable storage or use ssh to transmit the key
  97. from node to node. Then install the key with the command:
  98. unix# install -D --group=0 --owner=0 --mode=0400 /path_to_authkey/authkey /etc/ais/authkey
  99. If the message invalid digest appears, the keys are not the same on each node.
  100. Run the openais executive
  101. -------------------------
  102. Get one or more nodes and run the openais executive on each node. A list of
  103. node IPs should be logged when the nodes join a configuration. Run the
  104. aisexec program after following the previous directions.
  105. A final note on permissions:
  106. It is not absolutely required that openais executive runs as root. If
  107. it runs as root, it schedules at the highest round robin realtime
  108. priority and locks all pages into ram in case a swap would cause a delay
  109. in the real-time nature of the protocol. The warning about not being
  110. able to lock pages is simply a warning and can be ignored if you choose
  111. to run as a non root user.
  112. The ais user/group is required because applications are authenticated
  113. against the ais user and group. If an application(/library) is not root
  114. or ais, then the application cannot connect to the ais executive.
  115. please read SECURITY to understand the threat model assumed by openais
  116. and the techniques openais use to overcome these threats.
  117. Before running any of the test programs
  118. ---------------------------------------
  119. The openais executive will ensure security by only allowing the ais group (or
  120. uid root) to connect to the service. Switch to the ais group before
  121. running any applications linked to the saf api, or the applications will
  122. not be authenticated and won't be able to access services.
  123. [sdake@slickdeal sdake]$ su ais
  124. Password:
  125. [ais@slickdeal sdake]$ id
  126. uid=501(ais) gid=502(ais) groups=502(ais)
  127. Try out the openais CLM functionality
  128. -------------------------------------
  129. After aisexec is running
  130. su to ais user
  131. Run test/testclm on one node. Then kill and add nodes. This will cause
  132. callbacks to be called in the testclm application which will print out
  133. the node state changes. The testclm program will not print any output
  134. after it is started and has printed the current configuration until nodes
  135. are added to or deleted from the configuration by starting and stopping
  136. aisexec on other nodes.
  137. Killing aisexec on the node the testclm is connected will cause the
  138. API to return error codes indicating the system has failed.
  139. Try out the openais AMF functionality
  140. -------------------------------------
  141. After aisexec is running
  142. su to ais user
  143. The test/testamf{1-6} implement three seperate service units (SU). SU #1
  144. consists of testamf1, testamf2. SU #2 consists of testamf3, testamf4.
  145. SU #3 consists of testamf5, testamf6. The active and backup directives
  146. in groups.conf define how many SU's become active and how many
  147. become standby in the service group (SG).
  148. To test the openais AMF, run testamf3 and testamf4 on one node. Both
  149. components become in service and active. Then run testamf1. Nothing
  150. appears to happen, because testamf1 is not placed in service (and made
  151. standby) until testamf2 is registered. Running testamf2 will show
  152. a variety of state changes. testamf1 will match these state changes.
  153. testamf2 is special because is reports an error, and later cancels
  154. the error, causing the entire SU to go out of service, then back in
  155. service. This behavior is expected by the openais specification and the
  156. code in testamf2.c can be read for a clearer understanding of what
  157. is happening.
  158. Pressing ctrl-z to background the task (which causes the heartbeat to
  159. timeout) on a component will cause the remaining component to go
  160. out of service. If ctrl-z is pressed on the active SU, the standby
  161. SU will become active. CTRL-C on these tests behaves the same way.
  162. A crash behaves the same way.
  163. Try out the openais CKPT functionality
  164. --------------------------------------
  165. su to ais user
  166. run testckpt. This will execute various checkpoint API operations.
  167. run ckptbench. This will execute non-threaded write benchmarks.
  168. run ckptbenchth. This will execute threaded write benchmarks.
  169. The benchmark configuration (how many threads to run, how many writes
  170. per benchmark run, and data write size are specified in the ckptbench.c
  171. and ckptbenchth.c programs.
  172. Two node clusters should approach 8.5 MB/sec on 100 mbit networks for
  173. larger checkpoint sizes with encryption and authentication. If you are not
  174. seeing these results, please report to the mailing list.
  175. Try out the openais EVT functionality
  176. -------------------------------------
  177. su to ais user
  178. run testevt. This will execute various eventing API operations.
  179. Try out the openais EVS functionality
  180. -------------------------------------
  181. su to ais user
  182. run testevs. This will generate multicast messages and self deliver them
  183. run evsbench. This will display the benchmark performance of the evs service.
  184. Write your own applications
  185. ---------------------------
  186. Without real applications, finding the hard bugs will be difficult. Please
  187. port or write apps and let us know of the progress!
  188. Contribute!
  189. -----------
  190. Code, examples, documentation, bug reports, testing are all appreciated.
  191. Read the TODO or the ask on the mailing lists for ways to contribute.