| Small linux deployments » Clusterssh: Run the same commands simultaneously on multiple servers | System Administration and Web Application Development Blog

I’ve recently discovered clusterssh, a tool that opens up many xterm sessions and binds them all to one keyboard input. I use it for updating my servers or reconfiguring them all in the same way. For example, since most of my boxes run the same OS version, they all need package updates at the same time, so after I get a flurry of “Update available” emails I have a quick look at an eratta site to see what problems I’m fixing, and then I fire up clusterssh and run (for example) sudo yum update. Here’s a quick screenshot to show it in action:
Clusterssh
It works with clusters of servers, so you’ll have a configuration file like (~/.csshrc):

clusters = web-servers all-servers special-servers
all-servers = erek@libra.blumenthals.com erek@aquarius.blumenthals.com erek@scorpio.blumenthals.com erek@webserver1.blumenthals.com erek@webserver2.blumenthals.com
web-servers = erek@webserver1.blumenthals.com erek@webserver2.blumenthals.com
special-servers = erek@libra.blumenthals.com erek@aquarius.blumenthals.com erek@scorpio.blumenthals.com

Obviously, it works best if you have ssh keys set up to all of your servers. Then you can just run cssh , and it pops up ssh sessions with each of those servers. A simple tool that saves you a lot of time.

2 Responses to “Clusterssh: Run the same commands simultaneously on multiple servers”

  1. Gary Says:

    You should check out puppet (http://www.reductivelabs.com/projects/puppet/). It’s a different way of solving the same problem, but I find it works better than the ssh-multiplexing method. Plus it scales a lot higher — you can only connect to so many servers before it becomes overwhelming.

  2. Erek Dyskant Says:

    Gary, Thanks for the suggestion. I’ll definitely have a look at it. –Erek

Leave a Reply