QUICKSTART 7.0 KB

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