Re: Bug#97336: ITP: dsh -- dancer's shell, or a distributed shell.
Hi Rob,
Rob Latham wrote:
>
> it's a bit more fun (though harder to sort the output) if you do
>
> for a in $(seq 1 100); do rsh -n note-$a w & ; done
>
> and the obvious refinement is to prefix each line with the node name,
> then use sort with whatever parameters make it sort on the first
> column with no regard for other columns.
>
> it's those "whatever parameters" that keep me from backgrounding N rsh
> jobs on a regular basis. but for lots of tasks i can get away with it
> ( for example, the emulex fiber channel driver takes 10 seconds to
> load. on a 33 node cluster, that adds up fast )
Here's the script I use for sequential execution. It's the most robust
I've come up with. :P
borg:exa$ cat bin/doborg
#! /bin/sh
#for x in `cat ~/bin/nodes`; do
# rsh node$x $1;
#done
# mass ping all nodes
gen-nodes | strobe -p 514 -t 1 | grep "514 shell" | awk '{print $1;}' \
>/tmp/borg-upnodes-$USER
#trap "killall rsh" INTERRUPT
for x in `cat /tmp/borg-upnodes-$USER`; do
echo "remote execution on" $x
rsh $x $@;
done
I use another script called gen-nodes to generate a sequence of nodes, I don't
know. Kind of felt better abstraction that way. Using strobe works quite
fine if you'd try for yourself.
One thing: how would you do this fault tolerant with a shell script. I could
write a very robust cluster shell frontend in c/c++ but have no idea how you
could do that with a simple shell script.
Perhaps writing it in perl or tcl/tk would be a better idea.
Though I know that you could do quite complicated stuff just with a bash
script (mklibs.sh) :)
Thanks,
--
Eray Ozkural (exa)
Comp. Sci. Dept., Bilkent University, Ankara
e-mail: erayo@cs.bilkent.edu.tr
www: http://www.cs.bilkent.edu.tr/~erayo
Reply to: