The cluster comes with a simple parallel shell named pdsh. The pdsh shell is handy for running commands across the cluster. See the man page, which describes the capabilities of pdsh in detail. One of the useful features is the capability of specifying all or a subset of the cluster. For example:
pdsh -a <command> targets the <command> to all nodes of the cluster, including the master.
pdsh -a -x node00 <command> targets the <command> to all nodes of the cluster except the master.
pdsh -w node[01-08] <command> targets the <command> to the 8 nodes of the cluster named node01, node02, , node08.
Another utility that is useful for formatting the output of pdsh is dshbak. Here we will show some handy uses of pdsh.
pdsh -a mpdcleanup
pdsh -a ls -l /etc/ntp | dshbak -c
Here is a sample output:
[amit@onyx amit]$ pdsh -a ls -l /etc/ntp | dshbak -c ---------------- ws[01-16] ---------------- total 16 -rw-r--r-- 1 root root 8 Jun 4 11:53 drift -rw------- 1 root root 266 Jun 4 11:53 keys -rw-r--r-- 1 root root 13 Jun 4 11:53 ntpservers -rw-r--r-- 1 root root 13 Jun 4 11:53 step-tickers ---------------- ws00 ---------------- total 16 -rw-r--r-- 1 ntp ntp 8 Sep 5 21:51 drift -rw------- 1 ntp ntp 266 Feb 13 2003 keys -rw-r--r-- 1 root root 58 Oct 3 2003 ntpservers -rw-r--r-- 1 ntp ntp 23 Oct 3 2003 step-tickers ---------------- ws[17-32] ---------------- total 16 -rw-r--r-- 1 root root 8 May 27 13:31 drift -rw------- 1 root root 266 May 27 13:31 keys -rw-r--r-- 1 root root 13 May 27 13:31 ntpservers -rw-r--r-- 1 root root 13 May 27 13:31 step-tickers [amit@onyx amit]$