Say we have a small cluster with a couple of nodes.
To make life easier we want type each command once but have it executed
on each node. You then have to create a file in
$HOME/.dsh/group/clusterwname that lists the ip's of your cluster.
eg.
As an example we run ls on each of these machines
We use -g to use the mosix group (this way you can create subsets of a
group with different configurations)
Note that neither of the machines ask for a password.
This is because we have set up RSA authentication between the different
accounts. If you want to run commands with multiple parameters you will
either have to put the command between quotes.
[root@inspon root]# dsh -r ssh -g mosix "uname -a"
192.168.10.84: Linux omosix2.office.be.stone-it.com 2.4.17-openmosix1 #1
Wed May 29 14:32:28 CEST 2002 i686 unknown
192.168.10.220: Linux oscar0 2.4.17-openmosix1 #1 Wed May 29 14:32:28 CEST
2002 i686 unknown
or use the -c -- option. Both give basically the same output.
[root@inspon root]# dsh -r ssh -g mosix -c -- uname -a
192.168.10.220: Linux oscar0 2.4.17-openmosix1 #1 Wed May 29 14:32:28 CEST
2002 i686 unknown
192.168.10.84: Linux omosix2.office.be.stone-it.com 2.4.17-openmosix1 #1
Wed May 29 14:32:28 CEST 2002 i686 unknown