The mpadmin command has the following syntax.
# mpadmin [-c command] [-f filename] [-h] [-q] [-s cluster_name] [-V]
When you invoke mpadmin with the -c, -h, or -V options, it performs the requested operation and returns to the shell level.
When you invoke mpadmin with any of the other options (-f, -q, or -s), it performs the specified operation and then displays an mpadmin prompt, indicating that it is in the interactive mode. In this mode, you can execute any number of mpadmin commands until you quit the interactive session.
When you invoke mpadmin without any options, it goes immediately into the interactive mode, displaying an mpadmin prompt.
The mpadmin command-line options are summarized in Table 3-1 and more fully following the table.
Table 3-1 mpadmin Options
Option |
Description |
---|---|
-c command |
Execute single specified command. |
-f file-name |
Take input from specified file. |
-h |
Display help/usage text. |
-q |
Suppress the display of a warning message when a non-root user attempts to use restricted command mode. |
-s cluster-name |
Connect to the specified Sun HPC cluster. |
-V |
Display mpadmin version information. |
Use the -c option when you want to execute a single mpadmin command and return upon completion to the shell prompt. For example, the following use of mpadmin -c changes the location of the CRE log file to /home/wmitty/cre_messages:
# mpadmin -c set logfile="/home/wmitty/cre_messages" #
Most commands that are available via the interactive interface can be invoked via the -c option. See Chapter 6, mpadmin: Detailed Description for a description of the mpadmin command set and a list of which commands can be used as arguments to the -c option.
Use the -f option to supply input to mpadmin from the file specified by the file-name argument. The source file is expected to consist of one or more mpadmin commands, one command per line.
This option can be particularly useful in the following ways:
It can be used following use of the mpadmin command dump, which outputs all or part of a cluster's configuration in the form of an mpadmin script. If the dump output is stored in a file, mpadmin can, at a later time, read the file via the -f option, thereby reconstructing the configuration that had been saved in the dump output file.
The -f option can also be used to read mpadmin scripts written by the system administrator--scripts designed to simplify other cluster management tasks that involve issuing a series of mpadmin commands.
The -h option displays help information about mpadmin.
Use the -q option to suppress a warning message when a non-root user attempts to invoke a restricted command.
Use the -s option to connect to the cluster specified by the cluster-name argument.
Use the -V option to display the version of mpadmin.
From the perspective of mpadmin, a Sun HPC cluster consists of a system of objects, which include
The cluster itself
Each node contained in the cluster
Each partition (logical group of nodes) defined in the cluster
The net work interfaces used by the nodes
Each type of object has a set of attributes whose values can be operated on via mpadmin commands. These attributes control various aspects of their respective objects. For example, a node's enabled attribute can be
set to make the node available for use
unset to prevent it from being used
The CRE sets many attributes in a cluster to default values each time it boots up. Except for attribute modifications described here and in Chapter 6, mpadmin: Detailed Description, do not change attribute values.
mpadmin commands are organized into four contexts, which correspond to the four types of mpadmin objects. These contexts are summarized below and illustrated in Figure 3-1.
Cluster - These commands affect cluster attributes.
Node - These commands affect node attributes.
Network - These commands affect network interface attributes.
Partition - These commands affect partition attributes.
In the interactive mode, the mpadmin prompt contains one or more fields that indicate the current context. Table 3-2 shows the prompt format for each of the possible mpadmin contexts.
Table 3-2 mpadmin Prompt Formats
Prompt Formats |
Context |
---|---|
[cluster-name]:: |
Current context = Cluster. |
[cluster-name]Node:: |
Current context = Node, but not a specific node. |
[cluster-name]N(node-name):: |
Current context = a specific node. |
[cluster-name]Partition:: |
Current context = Partition, but not a specific partition. |
[cluster-name]P(partition-name):: |
Current context = a specific partition. |
[cluster-name]N(node-name) Network:: |
Current context = Network, but not a specific network interface. |
[cluster-name]N(node-name) I(net-if-name):: |
Current context = a specific network interface. |
When the prompt indicates a specific network interface, it uses I as the abbreviation for Network to avoid being confused with the Node abbreviation N.