QUICKSTART 10 KB

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