QUICKSTART 8.4 KB

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