Usha Guduri

PDSH - Parallel Distributed SHell

Unless your application is a serving such a small traffic or is in the Beta stage, you are probably working with a load-balanced set of servers - web/application/database - you name it. And when there is an issue, the task of looking at the logs on each of the servers is a nightmare!

One option is to run a remote command via ssh like:

1
$ ssh user@host “date”

But identifiying the server where you can find more information means running the above N times changing the host each time. For more involved tasks, it gets even more difficult. Oh and what if you accidentally missed a server and claimed that “something did not happen”! You can wrap the command in a loop and come up with a shell script (choose your own language), of course.

But pdsh simplifies all that. Its pretty much like your own wrapper, but only with more features - especially running in parallel. And fear not, its not learning another language. Even a simple run without too many options that it provides is enough to free up a ton of your time.

1
$ pdsh -R ssh -w user@host[1-8].full.name “date”

Looks so familiar, ain’t it? And all it does is parallel’ly run the date command remotely on host1 through host8.

Whoa! Thats how many keystrokes and minutes saved of your life?

Try it for yourself: Google Code

This is just a flyer ad for pdsh. More details will follow as I keep using it.

Comments