HP XC System Software Administration Guide Version 3.1
1.3.2 The nodelist Parameter
The nodelist parameter, used in several HP XC system commands, indicates one or more nodes. You
can use brackets, hyphens, and commas in the nodelist parameter:
[ ]
Brackets indicate a set of nodes. You can use only one set of brackets for each instance of the
nodelist parameter.
-
A hyphen indicates a range of nodes.
,
A comma separates node definitions.
For example, the nodes n1 n2 n3 n5 can be expressed in the nodelist parameter as n[1-3,5].
An example in “Using the pdsh Shell” illustrates the use of a nodelist parameter to specify a group of
nodes.
1.3.3 Executing a Command on Multiple Nodes
You can enter the HP XC system commands at the command line or invoke them remotely on a node in
the HP XC system using the pdsh shell or the cexec command. These commands enable you to execute
a command on multiple nodes at the same time. Use the cexec command when you need to log the
command. Use the pdsh command when logging is not required.
Some commands, like the power command, accept a list of nodes as a parameter; this parameter is often
referred to as a nodelist. These commands affect the nodes directly, without the need for the pdsh or
cexec commands.
You can use the HP XC commands in a cron script like any other command.
1.3.3.1 Using the pdsh Shell
The open source Parallel Distributed Shell (pdsh) command is a multithreaded remote shell client that
executes commands on multiple nodes in parallel. You can specify all nodes, a given number of nodes, or
only certain nodes to perform the command or commands passed as arguments to the pdsh command.
By default, the pdsh shell can issue 32 simultaneous remote commands at a time. You can override this
default with the -f option.
The pdsh shell relies on the ssh transport mechanism. Ensure that ssh is properly installed on the system;
changes to the ssh configuration might cause the pdsh shell to fail. Although the pdsh shell is capable
of using several remote shell services, including rsh and ssh, the security settings of the HP XC system
make ssh the shell of choice.
The format of this command is:
pdsh -[options] " command ... "
Important:
Do not pass a command that requires interaction as an argument to the pdsh command. Prompting from
the remote node can cause the command to hang.
The following example runs the uptime command on all the nodes in a four-node system.
# pdsh -a "uptime"
n4: 15:51:40 up 2 days, 2:41, 4 users, load average: 0.48, 0.29, 0.11
n3: 15:49:17 up 1 day, 4:55, 0 users, load average: 0.00, 0.00, 0.00
n2: 15:50:32 up 1 day, 4:55, 0 users, load average: 0.00, 0.00, 0.00
n1: 15:47:21 up 1 day, 4:27, 0 users, load average: 0.00, 0.00, 0.00
The -w option to pdsh command enables you to specify certain nodes. The following example uses this
option and a nodelist to specify only nodes n1, n2, and n3.
# pdsh -w n[1-3] "uptime"
n3: 15:53:09 up 1 day, 4:55, 0 users, load average: 0.00, 0.00, 0.00
n2: 15:54:37 up 1 day, 4:55, 0 users, load average: 0.00, 0.00, 0.00
n1: 15:58:11 up 1 day, 4:27, 0 users, load average: 0.00, 0.00, 0.00
1.3 HP XC Command Environment 33