mpadmin provides commands for performing the following operations:
Configuration control - These commands are used to create and delete mpadmin objects (nodes, partitions, network interfaces); see "Configuration Control".
Attribute control - These commands are used to set and reset attribute values; see "Attribute Control".
Context navigation - These commands are used to change the current context to a different context; see "Context Navigation".
Information retrieval - These commands are used to display object and attribute information; see "Information Retrieval".
Miscellaneous - See "Miscellaneous Commands".
A Sun HPC cluster contains one or more named partitions. Each partition contains some number of specific nodes. Likewise, each node includes one or more network interfaces that it uses for internode communication.
The CRE automatically creates the cluster, node, and network interface objects based on the contents of the hpc.conf file. Partitions are the only kind of object that the system administrator is required to create and manage.
Use the delete command to remove partitions, but no other types of cluster objects. Your remove nodes and network interfaces from a Sun HPC cluster by editing the hpc.conf file.
Usage:
:: create object-name
Available In:
Node, Partition, Network
The create command creates a new object with the name object-name and makes the new object the current context.
Note, partitions can only be created from within the Partition context. The following example creates the partition part0.
[node0] Partition:: create part0[node0] P(part0)::
As the second line in the example shows, part0 becomes the new context.
Usage:
:: delete [object-name]
Available In:
Node, Partition, Network
The delete command deletes the object specified by the object-name argument. The object being deleted must either be contained in the current context or must be the current context. The first example shows a partition contained in the current context being deleted.
[node0] Partition:: delete part0[node0] Partition::
If the current context is the object to be deleted, the object-name argument is optional. In this case, the context reverts to the next higher context level.
[node0] P(part0):: delete[node0] Partition::
Each mpadmin object has a set of attributes that can be modified. Use the set command to specify a value for a given attribute. Use unset to delete an attribute.
Although you can use the set and unset commands to change any cluster attribute, the CRE requires most attributes to have their default values. Be certain to limit your attribute changes to those described in this chapter.
Usage:
:: set attribute[=value]
Available In:
Cluster, Node, Partition, Network
The set command sets the specified attribute of the current object.
You must be within the context of the target object to set its attributes. For example, to change an attribute of a specific partition, you must be in that partition's context.
To set a literal or numeric attribute, specify the desired value. The following example sets the node attribute for partition part0. Setting a partition's node attribute identifies the set of nodes that are members of that partition.
[node0] P(part0):: set node=node1 node2[node0] P(part0)::
To change the value of an attribute that has already been set, simply set it again. The following example adds node3 to partition part0.
[node0] P(part0):: set node=+node3[node0] P(part0)::
As shown by this example, if the value of an attribute is a list, items can be added to or removed from the list using the + and - symbols, without repeating items that are already part of the list.
To set a Boolean attribute, specify the name of the Boolean attribute to be activated. Do not include =value in the expression. The following example enables partition part0.
[node0] P(part0):: set enabled[node0] P(part0)::
If you mistakenly set a Boolean attribute to a value--that is, if you follow a Boolean attribute's name with the =value field, mpadmin will ignore the value assignment and will simply consider the attribute to be active.
Usage:
:: unset attribute
Available In:
Cluster, Node, Partition, Network
The unset command deletes the specified attribute from the current object. You must be within the context of an object to unset any of its attributes.
Example:
[node0] P(part0):: unset enabled[node0] P(part0)::
disables the partition part0 (that is, makes it unavailable for use).
Remember, you cannot use the set command to set Boolean attributes to the logical 0 ( inactive) state. You must use the unset command.
By default, mpadmin commands affect objects that are in the current context--that is, objects that are in the same context in which the command is invoked. For example, if the command list is invoked in the Node context, mpadmin will list all the nodes in the cluster. If list is invoked in the Partition context, it will list all the partitions in the cluster, as shown below:
[node0] Partition:: list part0 part1 part2 [node0] Partition::
mpadmin provides several context navigation commands that enable you to operate on objects and attributes outside the current context.
Usage:
:: current object-name
Available In:
Cluster, Node, Partition, Network
The current command changes the current context to the context of the object specified by object-name. The target object must exist. That is, if it is a partition, you must already have used the create command to create it. If the target object is a cluster, node, or network interface, it must have been created by the CRE.
The following example changes the current context from the general Node context to the context of a specific node, node1.
[node0] Node:: current node1 [node0] N(node1)::
If the name of the target object does not conflict with an mpadmin command, you can omit the current command. This is illustrated by the following example, where node1 is the name of the target object.
[node0] Node:: node1[node0] N(hpc-node1)::
This works even when the object is in a different context.
[node0] Partition:: node1[node0] N(node1)::
The current command must be used when the name of the object is the same as an mpadmin command. For example, if you have a partition named Partition, its name conflicts with the command Partition. In this case, to make the object Partition the current context, you would need to include the current command to make it clear that the Partition term refers to the object and is not an invocation of the command.
Usage:
:: top
Available In:
Node, Partition, Network
The top command moves you to the Cluster context. The following example moves from the Partition context to the Cluster context.
[node0] Partition:: top[node0]::
Usage:
:: up
Available In:
Node, Partition, Network
The up command moves you up one level from the current context. The following example moves from the Network context to the context of node node2.
[node0] N[node2] Network:: up[node0] N[node2]::
Usage:
:: node
Available In:
Cluster
The node command moves you from the Cluster context to the Node context.
[node0]:: node[node0] Node::
Usage:
:: partition
Available In:
Cluster, Node, Network
The partition command moves you from the Cluster, Node, or Network context to the Partition context.
[node0]:: partition[node0] Partition::
Usage:
:: network
Available In:
Node
The network command moves you from a specific Node context to the Network context associated with that node.
[node0] N[node2]:: network[node0] N[node2] Network::
This set of commands displays information about
The specified object.
If no object is specified, the current context.
Usage:
:: dump [object-name]
Available In:
Cluster, Node, Partition
The dump command displays the current state of the attributes of the specified object or of the current context. The object can be
The entire cluster.
A specific partition.
All partitions in the cluster.
A specific node.
All nodes in the cluster.
The dump command outputs objects in a specific order that corresponds to the logical order of assignment when a cluster is configured. For example, nodes are output before partitions because, when a cluster is configured, nodes must exist before they can be assigned to a partition.
The dump command executes in this hierarchical manner so it can be used to back up cluster configurations in a format that allows them to be easily restored at a later time.
The following example shows the dump command being used in this way. In this example, it is invoked using the -c option on the mpadmin command line, with the output being directed to a backup file.
# mpadmin -c dump > sunhpc.configuration
Later, when it was time to restore the configuration, mpadmin could read the backup file as input, using the -f option.
# mpadmin -f sunhpc.configuration
If you wanted to modify the configuration, you could edit the backup file before before restoring it.
The following example shows the dump command being used to output the attribute states of the partition part0.
[node0] Partition:: dump part0 set nodes = node1 node2 node3 set max_total_procs = 4 set name = part0 set enabled unset no_login [node0] Partition::
Each attribute is output in the form of a set or unset command so that the dump output functions as a script.
If you are within the context of the object whose attributes you want to see, you don't have to specify its name.
[node0] P(part0):: dump set nodes = node1 node2 node3 set max_total_procs = 4 set enabled set name = part0 [node0] P(part0)::
Usage:
:: list
Available In:
Cluster, Node, Partition, Network
The list command lists all of the defined objects in the current context. The following example shows that there are three partitions defined in the Partition context.
[node0] Partition:: list part0 part1 part2 [node0] Partition::
Usage:
:: show [object-name]
Available In:
Cluster, Node, Partition, Network
The show command displays the current state of the attributes of the specified object object-name. The following example displays the attributes for the partition part0.
[node0] Partition:: show part0 set nodes = node0 node1 node2 node3 set max_total_procs = 4 set name = part0 set enabled unset no_login [node0] Partition::
If the object whose attributes you want to see is in the current context, you don't have to specify its name. For example:
[node0] P(part0):: show set nodes = node0 node1 node2 node3 set max_total_procs = 4 set enabled set name = part0 [node0] P(part0)::
Usage:
:: connect cluster-name
Available In:
Cluster
In order to access any objects or attributes in a Sun HPC cluster, you must be connected to the cluster.
However, connecting to a cluster ordinarily happens automatically, so you are not likely to ever need to use the connect command.
The environment variable SUNHPC_CLUSTER names a default cluster. If no other action is taken to override this default, any mpadmin session will connect to the cluster named by this environment variable.
If you issue the mpadmin command on a node that is part of a cluster, you are automatically connected to that cluster, regardless of the SUNHPC_CLUSTER setting.
If you are not logged in to the cluster you want to use and you do not want to use the default cluster, you can use the mpadmin -s option, specifying the name of the cluster of interest as an argument to the option. See "-s cluster-name - Connect to Specified Cluster" for a description of the -s option.
When the CRE creates a cluster, it always names it after the hostname of the cluster's master node--that is, the node on which the master daemons are running. Therefore, whenever you need to specify the name of a cluster, use the hostname of the cluster's master node.
If, for some reason, you want to use the connect command, see the following example. It shows the command being used to connect to a cluster whose master node is node0.
[hpc-demo]:: connect node0[node0]::
Usage:
:: echo text-message
Available In:
Cluster, Node, Partition, Network
The echo command prints the specified text on the standard output. If you write a script to be run with mpadmin -f, you can include the echo command in the script so that it will print status information as it executes.
[node0]:: echo Enabling part0 and part1Enabling part0 and part1 [node0]::
Usage:
:: help [command]
Available In:
Cluster, Node, Partition, Network
When invoked without a command argument, the help command lists the mpadmin commands that are available within the current context. The following example shows help being invoked at the Cluster level
[node0]:: helpconnect <cluster-name> connect to a Sun HPC cluster set <attribute>[=value] set an attribute in the current context unset <attribute> delete an attribute in the current context show show attributes in current context dump show all objects on the cluster node go to the node context partition go to the partition context echo ... print the rest of the line on standard output quit quit mpadmin help [command] show information about command command? [command] show information about command command[node0]::
To get a description of a particular command, enter the command name as an argument to help.
If you specify a context command (node, partition, or network), mpadmin lists the commands available within that context. Note that you can specify network as an argument to help only at the node level.
[node0]:: help nodecurrent <node> set the current node for future commands create <node> create a new node with the given name delete [node] delete a node list list all the defined nodes show [node] show a node's attributes dump [node] show attributes for a node and its network interfaces set <attribute>[=value] set the current node's attribute unset <attribute> delete the current node's attribute network enter the network interface command mode up go up to the Cluster level command prompt top go up to the Cluster level command prompt echo ... print the rest of the line on standard output help [command] show information about command command? [command] show information about command command[node0]::
The "?" character is a synonym for help.
Usage:
:: quit :: exit
Available In:
Cluster, Node, Partition, Network
Entering either quit or exit causes mpadmin to terminate and return you to the shell level.
Example:
[node0]:: quit#
Example:
[node0] N(node2):: exit#