C H A P T E R 1 |
You can use the CMM API to develop programs for highly available clusters running the Foundation Services. For more information, see the following topics:
The CMM API provides a programming interface to the Cluster Membership Manager (CMM). For information about the CMM, see the Netra High Availability Suite 3.0 1/08 Foundation Services Overview.
The CMM API enables you to write applications that manage peer nodes in the cluster and that monitor the role, qualification level, and state of these peer nodes. You can use the CMM API to obtain information about which node is the master node, the vice-master node, and a member of the cluster.
The CMM API also provides functions that modify the state of a cluster and enable a node to receive information about changes in the state of a cluster.
This interaction of the CMM API with the Netra HA Suite software is illustrated in FIGURE 1-1.
The CMM API enables you to create highly available applications to determine which nodes are in the cluster, and which of these nodes is the master node and the vice-master node. The main functions of the CMM API are to:
The CMM API has the following multithreading characteristics:
It is multithread safe: mutual exclusion among threads is guaranteed when critical sections of the API are executed.
The CMM API calls cannot be interrupted by signals: If a signal is caught during a call, the call runs to completion. The call is not aborted and does not return an error in this case.
Examples of the CMM API are provided in the SUNWnhas-cmm-headers for the Solaris OS package and sun-nhas-cmm-headers-3.0-*.86_amd64.rpm for the Linux OS. These examples are available after installation on a peer node, in the /opt/SUNWcgha/examples/cmm_API directory for the Solaris OS or the /opt/sun/nhas/examples/cmm_API directory for the Linux OS.
The locations of the CMM API header file and the default location for the CMM API library files differ depending on the operating system (OS) used.
For the Solaris OS, the CMM API header file, cmm.h, is located in the /opt/SUNWcgha/include/cmm directory. The default location of the CMM API library files is the /opt/SUNWcgha/lib directory.
To access the CMM API header file and libraries on the Solaris OS, install the SUNWnhas-cmm-headers and SUNWnhas-cmm-libs packages in your development environment.
For the Linux OS, the cmm.h file, is located in the /opt/sun/include directory and the default location of the CMM API library files is the /opt/sun/lib directory for 32-bit applications or the /opt/sun/lib64 directory for 64-bit applications.
To access the CMM API header file and libraries on the Linux OS, install the sun-nhas-cmm-headers-3.0-*.x86_amd64.rpm and sun-nhas-cmm-libs-3.0-*.x86_amd64.rpm packages in your development environment.
See Chapter 3 and Chapter 4 for information about creating a development environment for the Foundation Services product.
Copyright © 2008, Sun Microsystems, Inc. All rights reserved.