The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.

Things look quiet here. But I've been doing a lot of blogging at because I prefer WordPress now. Not all my posts there are FreeBSD related. I am in the midst of migrating The FreeBSD Diary over to WordPress (and you can read about that here). Once the migration is completed, I'll move the FreeBSD posts into the new FreeBSD Diary website.

cssh - cluster ssh 26 January 2010
Need more help on this topic? Click here
This article has 1 comment
Show me similar articles

Have you ever needed to do the same task on more than one machine at a time? If so, then clusterssh is the tool for you. From their homepage:

ClusterSSH is a tool for making the same change on multiple servers at the same time. The 'cssh' command opens an administration console and an xterm to all specified hosts. Any text typed into the administration console is replicated to all windows. All windows may also be typed into directly.

This tool is intended for (but not limited to) cluster administration where the same configuration or commands must be run on each node within the cluster. Performing these commands all at once via this tool ensures all nodes are kept in sync.

I found cssh very useful when I was setting up some jails, each of which was used for Bacula regression testing.


Using cssh is easy. First, install it:

cd /usr/ports/security/cssh
make install clean

This assumes you have x11/xterm installed (I did). Then run it:

cssh mysql41 mysql50 mysql51 mysql54

The following screen shot shows the above session opened and running with crontab -e:

The small window in the top left is cssh. This is where you type commands that will be echoed to each window. If you need to do something with just one window, click on it and type away. When you want to control all the session again, click on the cssh window.

This is something I will be using often.

Need more help on this topic? Click here
This article has 1 comment
Show me similar articles