home icon contact icon rss icon

Textmode

tools I use

ClusterSSH, SSH to multiple servers (Rails Deployment)

If you have a cluster of similar machines, for example Ruby on Rails deployment hosts, you often need to run the same configuration or monitoring tasks on all of them.

Much like capistrano, ClusterSSH provides you a way to execute commands in multiple hosts at once.

The setup of ClusterSSH is very easy, just install it and run:


sudo cssh -u > /etc/csshrc

This will generate the basic, system-wide configuration file, which let’s you configure a lot of options.

Now, to add your hosts I created the file ~/.csshrc in my Home directory, containing for example:


host1 = example1.com:2300
host2 = example2.com
hosts3 = example3.com user@example4.com
group1 = host1 host2
all = host1 host2 hosts3

I think thats pretty straight forward.

Now if you type in cssh group1 at your command prompt, you will get one main control terminal to issue commands, which are then executed in the additional server terminals.


Vincent Wang said

Dec 02, 2009 @ 08:20 AM

you can also try tmux(http://tmux.sf.net) with synchronize-panes command, that is better for me :)

RSS feed for comments on this post

Leave a Comment