Saturday 8 June 2013

Run script in multiple machines in parallel

Run script in multiple machines in parallel

I am interested to know the best way to start a script in background in multiple machines as fast as possible. Currently I'm doing this
Run for each ip address ssh user@ip -t "perl ~/setup.pl >& ~/log &" &
But this takes time as it individually tries to SSH into each one by one to start the setup.pl in background in that machine. This takes time as I've a large number of machines to start this script on.
I tried using GNU parallel, but couldnt get it to work properly:
seq COUNT | parallel -j 1 -u -S ip1,ip2,... perl ~/setup.pl >& ~/log
But it doesnt seem to work, I see the script started by GNU parallel in target machine, but its stagnant. I dont see anything in the log.
What am I doing wrong in using the GNU parallel

No comments:

Post a Comment