HP XC System Software Administration Guide Version 2.1
given number of nodes, or only certain nodes to pe
rform the com mand or commands passed as
arguments to the pdsh command.
The pdsh shell relies on the ssh transport mechanism. Ensure that ssh is properly installed
on the system; changes to the ssh con fig ur ation might cause the pdsh shell to f ail. Althoug h
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 f ormat of this com m a nd is:
pdsh [optio ns ] " command ... "
_________________________ Note _________________________
Do not pass a comm and that requires interaction as an argument to the pdsh
command. Prompting from the rem ote node may cause the command to hang.
The following example runs the uptime com m a nd on all th e 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
See the pdsh(1) manpage for additional informatio n. You can also find additional information
at the following Web site:
http://www.llnl.gov/linux/pdsh/
1.4.3.2 Using the cexec Command
The cexec command provides the same facility as the pdsh com mand and it offers two
additional features:
•Thecexec com m and provides an additional option, which enables yo u to specify a h ost
group or a service group:
- A host group is a designated list of nodes.
- A ser vice gro up is a list of nodes and the services that are configured to run on them.
• The output of the cexec commandisloggedasaneventin/var/log/nodename
(where nodename indicates the no de on which the com mand w as run) but the output of
the pdsh command is not.
The f ormat of this com m a nd is:
cexec [options] " command ... "
_________________________ Note _________________________
Do not pass a command that requires interaction as an argument to the cexec
command. Prompting from the rem ote node may cause the command to hang.
Useful command options include the following:
-a
Targets all nodes.
-l username
Runs the remote commands as the specified user.
-w nodename,...
Sets a list of target nodes.
-x nodename,...
Sets a list of target nodes to be excluded.
The following example runs the users command on all the nodes in a four node system:
1-6 HP XC Administrative Environment