IBM Books

Administration Guide


The parallel management commands

The SP system provides several parallel management commands. They all have a common syntax and are based on dsh, sysctl, hostlist, and dshbak commands. More complete descriptions of each is provided in the book PSSP: Command and Technical Reference.

|PSSP 3.4 supports three environment variables to let you pick |whether you want the PSSP software to use AIX rsh and |rcp remote commands or a secure remote command process for parallel |management commands like dsh, pcp, and others. The following are the |environment variables and how to use them: |

|RCMD_PGM
|Enable use of the executables named by the DSH_REMOTE_CMD and |REMOTE_COPY_CMD environment variables. The default is |rsh. Set to secrshell to enable a secure remote |command process.

|DSH_REMOTE_CMD
|Specify the path and name of the remote command executable. The |default with rsh is /bin/rsh. The default with |secrshell is /bin/ssh.

|REMOTE_COPY_CMD
|Specify the path and name of the remote copy command executable. |The default with rsh is /bin/rcp. The default |with secrshell is /bin/scp. |

|Like the restricted root access option, a secure remote command process |can also be enabled by using the SP Site environment SMIT menu or |the spsitenv command. It is extremely important to keep |these environment variables consistent and set to the remote command process |you want to use. See Secure remote command process for more information.

The syntax of the parallel management commands is:

command_name
remote_host_specification cmd_args_flags

where:

command_name
The name of a parallel command

remote_host_specification
Indicates which hosts the command should be executed on. Can be a range of slots, a list of hostnames, a set of flags to the hostlist command, or read from stdin.

cmd_args_flags
The flags and arguments to the command

Where appropriate, the output from the parallel management commands is filtered as described previously.

The following parallel management commands are based on dsh.

pexec

This application issues a command in parallel on the specified hosts. Any arguments to the commands are passed along with the command name. Results are filtered as described in Output from dsh. For example, to show which users are logged on nodes in slots 5-8, use the command:

pexec 5-8 who

pexscr

This application executes commands in parallel on different hosts, including the local host. Unlike pexec, the commands might differ on different hosts. Lines consisting of hostname: command are read from stdin. When the lines have been read, each command is executed on the corresponding host in parallel. Remote commands are executed by the remote command process enabled with the RCMD_PGM and the DSH_REMOTE_CMD environment variables and local commands are executed directly. For example, you could create file /etc/doit on r05n09 containing the following text:

r05n09: /usr/lpp/ssp/rcmd/bin/rcp /tmp/bozoid tserv11:/tmp/bozoid
r05n09: /usr/lpp/ssp/rcmd/bin/rcp /tmp/bozoid r05n01:/tmp/bozoid
r05n01: backup_script
r05n15: backup_script

Then, to copy the local file /tmp/bozoid to tserv11 and r05n01 and simultaneously start backup scripts on r05n01 and r05n15, issue the command:

pexscr < /etc/doit

pcp

|This command distributes a local file or directory to remote hosts |in parallel. To use this command, you must be authorized to issue |commands of the form:

|$REMOTE_COPY_CMD localfile
|remotehost: remotefile

for each of the hosts to which the file is to be copied. To recursively copy /etc/new/ on the local host to /etc/new1/ on the host in the first slot of each of the first four frames, use the command:

pcp "-s 1-4:1" -r /etc/new/ /etc/new1/

p_cat

This application issues the cat command in parallel on the specified hosts. Any arguments to the command are passed along with the command name. Results are not filtered. For example, the command

p_cat "-w host1,host2,host3" /etc/file > localfile

copies the contents of the /etc/file files on each of the hosts to the localfile file on the local host. localfile would consist of unmodified lines from /etc/file on host1, on host2, and on host3 concatenated together.

pls, pfind, prm, pps, pmv

These commands issue the ls, find, rm, ps, or mv commands in parallel on the specified hosts. Any arguments to the AIX commands are passed along with the command name. Results are filtered. For example,

pls "-av -e badnode" /

lists the contents of the root directory on all the responding hosts in the SP system with the exception of "badnode". Note that the -i flags to mv and rm are not supported because dsh doesn't propagate the stdin of the remote hosts.

Examples

For example, a working collective could be set up with hostlist:

hostlist -av > /tmp/wcoll
export WCOLL=/tmp/wcoll

pps "" -ef

would list information about all the processes on the nodes in the working collective.

pfind "" /usr/lpp/ssp/bin/  -name "pfind" -print

might result in the following:

HOSTS =========================================================================
r05n01             r05n03dx           r05n05             r05n07
r05n09             r05n10             r05n13             r05n14dx
r05n15             r05n16
 ===============================================================================
 /usr/lpp/ssp/bin/pfind

pmv "" /tmp/foo /tmp/newfoo

would rename /tmp/foo on all the working collective.

pls "" /tmp/\\*foo

could result in the following output:

HOSTS =========================================================================
r05n01             r05n03dx           r05n05             r05n07
r05n09             r05n10             r05n13             r05n14dx
r05n15             r05n16
===============================================================================
/tmp/newfoo

Note that the shell metacharacter is escaped twice, once to protect it from the shell, and once to protect it when the remote commands are done by dsh.

prm "" /tmp/newfoo

would remove /tmp/newfoo from all the nodes in the working collective.

ppred

This application issues a ksh test on each node in parallel and runs commands based on the results of the test. For example,

ppred 1-16 '-f /etc/foo' 'echo Here' 'echo Not here'

could result in output like the following:

HOSTS==============================================================
host1             host2              host3             host4
host5             host6              host8
===================================================================
Here
 
HOSTS==============================================================
host7             host9              host10            host11
host12            host13             host14            host15
host16
===================================================================
Not here

pfps

pfps is a parallel process find application. It takes arguments similar to those of the find command, but operates on processes instead of files. In addition, access control list-based permissions to nice or kill processes is provided. For example, to signal all the "daemond" processes in the SP system partition in parallel, a user that was in the /etc/sysctl.pfps.acl file on each node could issue the following:

pfps "-a" -tn sysctld -kill HUP

For example, to list the sysctl daemon processes on nodes r05n15 and r05n16, use the command:

pfps "-w r05n15,r05n16" -tn sysctld -print

The output is similar to the following:

HOSTS =========================================================================
r05n15
===============================================================================
USER       PID %CPU %MEM   SZ  RSS    TTY STAT    STIME  TIME COMMAND
root     11172  0.0  1.0  452  420      - S    11:54:47  0:00
/usr/lpp/ssp/bin/sysctld -l /var/adm/SPlogs/sysctl/sysctld.log
root     12497  0.0  1.0  300  360      - S    06:24:19  0:00
/usr/lpp/ssp/bin/sysctld -l /var/adm/SPlogs/sysctl/sysctld.log
 
HOSTS =========================================================================
r05n16
===============================================================================
USER       PID %CPU %MEM   SZ  RSS    TTY STAT    STIME  TIME COMMAND
root      7089  0.0  1.0  448  420      - S    11:54:48  0:00
/usr/lpp/ssp/bin/sysctld -l /var/adm/SPlogs/sysctl/sysctld.log
root      8423  0.0  1.0  296  360      - S    13:01:31  0:00
/usr/lpp/ssp/bin/sysctld -l /var/adm/SPlogs/sysctl/sysctld.log
root     10418  0.0  1.0  512  504      - S

pdf

pdf is a parallel command that performs function similar to df. It provides more information than the df command. To get file system information from all the nodes on the first slots of each of four frames, use the commands:

hostlist -s 1:1-4 > /tmp/wcoll
export WCOLL=/tmp/wcoll
pdf ""

To find information on the /var file system on the nodes in the working collective, use the command:

pdf "" /var
 

The output is similar to the following:

Filesystem                Size-KB Used-KB Free-KB %Free  iUsed  iFree %iFree
===================       ======= ======= ======= =====  =====  ===== ======
HOST: r05n01
============
/var                         8192    2452    5740   71%    279   1769    87%
 
HOST: r05n03dx
==============
/var                         8192    1988    6204   76%    214   1834    90%
 
HOST: r05n05
============
/var                         8192    2080    6112   75%    223   1825    90%
 
HOST: r05n07
============
/var                         8192    2080    6112   75%    223   1825    90%
 
HOST: r05n09
============
/var                         8192    2088    6104   75%    223   1825    90%
 
HOST: r05n10
============
/var                         8192    2448    5744   71%    286   1762    87%
 
HOST: r05n13
============
/var                         8192    2220    5972   73%    229   1819    89%
 
HOST: r05n14dx
==============
/var                         8192    2012    6180   76%    221   1827     90%
 
HOST: r05n15
============
/var                         8192    2368    5824   72%    220   1828    90%
 
HOST: r05n16
============
/var                         8192    2100    6092   75%    225   1823    90%

pfck

pfck displays file system information in parallel based on various usage criteria. For example, to find information on all the file systems on the hosts in POE host list file hostlist that have used more than 100000 KB, use the command:

MP_HOSTFILE=./hostlist pfps "" -s 100000

To display the filesystems on hosts r05n16 and r05n15 that have more than 90% of their space used, use the command:

pfck "-w r05n15,r05n16" -pu 90

The output is similar to the following:

Filesystem                Size-KB Used-KB Free-KB %Free  iUsed  iFree %iFree
===================       ======= ======= ======= =====  =====  ===== ======
HOST: r05n15
============
/usr                       331776  327640    4136    2%  17673  66295    79%
 
HOST: r05n16
============
/usr                       331776  327640    4136    2%  17673  66295     79%

To find all the /var file sytems in the SP system that are 95% full, use the command:

pfck "" -pu 95 | egrep "(var|HOST)"

The output is similar to the following:

 Filesystem                Size-KB Used-KB Free-KB %Free  iUsed  iFree %iFree
 ===================       ======= ======= ======= =====  =====  ===== ======
 HOST: r05n10
 /var                       335872  331412    4460    2%  17819  66149    79%
 HOST: r05n13
 /var                       335872  331632    4240    2%  17820  66148    79%
 HOST: r05n14dx
 /var                       335872  331388    4484    2%  17817  66151    79%


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]