|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
13.5 Managing Resources Directly with the Native Interface
13.5.1 Native Interface OverviewThe native interface allows a site to augment or even fully replace a resource manager for managing resources. In some situations, the full capabilities of the resource manager are not needed and a lower cost or lower overhead alternative is preferred. In other cases, the nature of the environment may make use of a resource manager impossible due to lack of support. Still, in other situations it is desirable to provide information about additional resource attributes, constraints, of state from alternate sources. In any case, Moab provides the ability to directly query and manage resources along side of or without the use of a resource manager. This interface, called the NATIVE interface can also be used to launch, cancel, and otherwise manage jobs. This native interface offers several advantages including the following:
However, the NATIVE interface may also have some drawbacks:
At a high level, the native interface works by launching threaded calls to perform standard resource manager activities such as managing resources and jobs. The desired calls are configured within Moab and used whenever an action or updated information is required. 13.5.2 Configuring the Native InterfaceUsing the native interface consists of defining the interface type and location. As mentioned earlier, a single object may be fully defined by multiple interfaces simultaneously with each interface updating a particular aspect of the object. 13.5.2.1 Configuring the Resource ManagerThe native resource manager must be configured using the RMCFG parameter. To specify the native interface, the TYPE attribute must be set to NATIVE.
13.5.2.2 Reporting ResourcesTo indicate the source of the resource information, the CLUSTERQUERYURL attribute of the RMCFG parameter should be specified. This attribute is specified as a URL where the protocols FILE, EXEC, HTTP, GANGLIA, and SQL are allowed. If a protocol is not specified, the protocol EXEC is assumed.
This simple example queries a file on the server for information about every node in the cluster. This differs from Moab remotely querying the status of each node individually.
13.5.3 Generating Cluster Query Data13.5.3.1 Flat Cluster Query DataIf the EXEC, FILE, or HTTP protocol is specified in the CLUSTERQUERYURL attribute, the data should provide flat text strings indicating the state and attributes of the node. The format follows the Wiki Interface Specification where attributes are delimited by white space rather than semicolons (;):
13.5.3.2 Interfacing to MySQLMoab can query a database to gather information about a cluster's compute node resources. An example configuration can be as follows:
Moab attempts to connect to the database MyNodes running on localhost as the user username. Once connected to MyNodes, Moab queries the table Nodes. This table must be set up to match the Full format just described. If the connection is successful, node information is populated based on the information found in the database. 13.5.3.3 Interfacing to GangliaMoab can use the information returned from Ganglia, a cluster or grid monitoring system. The information returned from Ganglia is combined with the information reported from other resource managers. An example configuration can be as follows:
<NodeName> is the name of a machine with Ganglia running on it. Also, <Port> is the XML port number to query Ganglia. If only ganglia:// is supplied as the CLUSTERQUERYURL, Moab queries the localhost on Ganglia's default port, 8649. If Ganglia and Moab are running on different machines, the machine running Moab needs to be specified as a trusted host in Ganglia's configuration file. Because Ganglia does not manage a job queue, Moab cannot control it or manage it; rather, Moab can only read in information. TORQUE reports nodes and can start jobs on those nodes. Moab and TORQUE can run concurrently without any issue because their functions do not overlap. However, it is mostly true that if Ganglia and TORQUE report conflicting data, you will want to trust TORQUE over Ganglia. For this reason you give the Ganglia resource manager the slavepeer flag. Also, Ganglia cannot report node state where state means availability to run jobs. NOTE: To verify that Ganglia is correctly reporting information, issue the mdiag -R -v command or run telnet localhost 8649 and verify that appropriate XML is displayed. 13.5.3.4 Interfacing to FLEXlmMoab can interface with FLEXlm to provide scheduling based on license availability. Informing Moab of license dependencies can reduce the number of costly licenses required by your cluster by allowing Moab to intelligently schedule around license limitations. Provided with Moab in the tools directory is a Perl script, license.mon.FLEXlm.pl. This script queries a FLEXlm license server and gathers data about available licenses. This script then formats this data for Moab to read through a native interface. This script can easily be used by any site to help facilitate FLEXlm integration; the only modification necessary to the script is setting the $FLEXlmCmd to specify the local command to query FLEXlm. To make this change, edit license.mon.FLEXlm.pl and, near the top of the file, look for the following line: Set the $FLEXlmCmd to the appropriate value for your system to query a license server and license file (if applicable). If lmutil is not in the PATH variable, specify its full path. Using lmutil's -a argument causes it to report all licenses. The -c option can be used to specify an optional license file. To test this script, run it manually. If working correctly, it produces output similar to the following: If the output looks incorrect, set the $LOGLEVEL variable inside of license.mon.FLEXlm.pl, run it again, and address the reported failure. Once the license interface script is properly configured, the next step is to add a license native resource manager to Moab via the moab.cfg file:
Once this change is made, restart Moab. The command mdiag -R can be used to verify that the resource manager is properly configured and is in the Active state. Detailed information regarding configured and utilized licenses can be viewed by issuing the mdiag -n. Floating licenses (non-node-locked) are reported as belonging to the GLOBAL node. NOTE: Due to the inherent conflict with the plus sign (+), the provided license manager script replaces occurrences of the plus sign in license names with the underscore symbol (_). This replacement requires that licenses with a plus sign in their names be requested with an underscore in place of any plus signs. Interfacing to Multiple License Managers Simultaneously If multiple license managers are used within a cluster, Moab can interface to each of them to obtain the needed license information. In the case of FLEXlm, this can be done by making one copy of the license.mon.FLEXlm.pl script for each license manager and configuring each copy to point to a different license manager. Then, within Moab, create one native resource manager interface for each license manager and point it to the corresponding script as in the following example:
NOTE: For an overview of license management, including job submission syntax, see Section 13.7, License Management. NOTE: It may be necessary to increase the default limit, MMAX_GRES. (See Appendix D for more implementation details.) 13.5.4 Configuring Node Specific Query URLsIt is possible to have a separate CLUSTERQUERYURL for each node. This is possible using the NODECFG parameter for each node or for the DEFAULT node. Moab looks first on the specific node for CLUSTERQUERYURL information. If no information is found on the specific node it looks for CLUSTERQUERYURL information on the resource manager. If the resource manager has no query information specified, then it uses the CLUSTERQUERYURL command configured for the DEFAULT node. The example configuration that follows demonstrates a possible setup:
In the preceding example, a four-node cluster and a license manager are controlled via the native interface. The state of the four compute nodes is determined by running the /usr/local/bin/query.pl query command (remotely on the node) and specified within the DEFAULT NODECFG parameter while querying the license manager is accomplished using the /usr/local/bin/flquery.cgi script. For local executable scripts, the launched script is either locally generated or taken from the library of contributed native scripts included with the distribution file. An optional parameter, RESOURCELIST, may be specified to constrain which resources obtained by the native interface should be processed. By default, all resources described by the interface data are loaded for *FULL interfaces, as are all existing resources described by *EXT interfaces. The RESOURCELIST parameter, if specified, acts as a filter eliminating either full or extension resource information from being incorporated. If an environment exists where data is not aggregated, and the native interface provides primary node information, the RESOURCELIST parameter is required to indicate to Moab which resources should be in the cluster. 13.5.5 Configuring Resource TypesNative resource managers can also perform special tasks when they are given a specific resource type. These types are specified using the RESOURCETYPE attribute of the RMCFG parameter.
13.5.6 Creating New Tools to Manage the ClusterUsing the scripts found in the $TOOLSDIR ($INSTDIR/tools) directory as a template, new tools can be quickly created to monitor or manage most any resource. Each tool should be associated with a particular resource manager service and specified using one of the following resource manager URL attributes:
See Also
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| © 2001-2008 Cluster Resources, Incorporated | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||