top | item 2397402

Cluster SSH (OSX)

124 points| xtacy | 15 years ago |code.google.com | reply

58 comments

order
[+] res0nat0r|15 years ago|reply
Also I'd recommend kanif:

http://taktuk.gforge.inria.fr/kanif/

This is a great tool to do mass changes to our 1200 CPU compute cluster. The best part about this is, it will map all of the hosts with the same output together and reduce this down to just one instance of the output, with the affected hostnames listed together. So instead of 500 instances of the same output data I get one. This comes in handy for finding hosts which are different than what I'm looking for.

Simple example:

  --------------------------------------------------------------------------------
  compute[0009,0051,0187] (3 HOSTS)
  --------------------------------------------------------------------------------
  Filesystem            Size  Used Avail Use% Mounted on
  /dev/mapper/rootvg-rootlv
                         58G   14G   42G  25% /
  --------------------------------------------------------------------------------
  compute[0013,0038,0044,0046,0065,0103,0125,0142,0195,0213,0216,0234] (12 HOSTS)
  --------------------------------------------------------------------------------
  Filesystem            Size  Used Avail Use% Mounted on
  /dev/mapper/rootvg-rootlv
                         58G   11G   44G  19% /
  --------------------------------------------------------------------------------
    compute0247 (1 HOST)
  --------------------------------------------------------------------------------
  Filesystem            Size  Used Avail Use% Mounted on
  /dev/mapper/rootvg-rootlv
                       58G  7.6G   47G  15% /
[+] rw|15 years ago|reply
Many companies manage their small clusters mostly by hand, even if they know there should be a better way. You just showed me one better way--thanks!
[+] drx|15 years ago|reply
Cluster SSH is a terrific tool. When I learned of it I coded up a quick python script to play selected tracks of MIDI files and used CSSH to play Bach's Toccata and Fugue in D minor polyphonically on ~20 computers' PC speakers.

It was also fun to terrify first year students with 20 cd trays ejecting at the same time...

[+] kowsik|15 years ago|reply
isn't ejecting cd trays so, like, 90's :) glad my mac book doesn't have one!
[+] JonnieCache|15 years ago|reply
This is surely the most elaborate excuse ever for not writing those maintenance scripts?
[+] VMG|15 years ago|reply
Could be worthwhile seeing when something goes wrong on one machine. It would be great to bundle all terminals that look the same though
[+] ceejayoz|15 years ago|reply
It's great for those little tweaks like adding a symbolic link.
[+] tlrobinson|15 years ago|reply
Neat idea, though I feel like it would be better implemented as a command line tool using ncurses or something similar so it could be used on any Unixy system (including logged into another server, for example)
[+] scottm01|15 years ago|reply
I suppose april fools is the reason we've gotten so far through this discussion that only scattered mentions of fabric or puppet/chef?

I've certainly done my share of ssh in a for loop, but if you're seriously considering this you almost certainly want to look into puppet/chef/cfengine/etc.

[+] splitrocket|15 years ago|reply
Now that <a href="http://devstructure.com>blueprint</a>; exists, it's radically simple to turn your current environment into chef/puppet deploy script. That said, distributed shell tools like this are still tremendously useful and should be part of any cluster stack.
[+] ez77|15 years ago|reply
tmux equivalent:

  C-b % [n times, n panes]
  C-b M-5 [tiled layout]
  ### ssh into your servers in each pane, or whatever
  C-b : setw sy <tab> [short for "synchronize-panes"]
  ### have synced fun!
[+] rilindo|15 years ago|reply
This like these always makes me uneasy. Yes, you can do stuff on X number of machines all at the same time. That also means you can break things all at the same time.
[+] elliottcarlson|15 years ago|reply
Only use I can see if for multi-system stats - which should be handled differently anyhow, but that's a different story. Perhaps running htop, bwm-ng, iftop or other similar tools. Would certainly be scary to do anything other than that...
[+] 9999|15 years ago|reply
CSSHX + sudo su is cruise control for cool.
[+] taylorbuley|15 years ago|reply
If you run rm -r / you'll learn where they got the name "cluster" from
[+] swah|15 years ago|reply
This should look great in movies.
[+] mccutchen|15 years ago|reply
This seems like something that would be much better if integrated into a tool like Fabric or Capistrano that already knows how to send SSH commands to a bunch of different servers.

Does anything like that exist? I guess the downside would be fixing problems if your command failed in 1 or 2 of 10 or 20 servers… Then you'd have to open up a separate session to those servers to figure out what was going on.

[+] th0ma5|15 years ago|reply
gnu parallel might be a nice choice for this sort of thing as well.

also for clusters i wrote a python script using libcloud that connects multiple terminals and does some bastardized map/reduce type helper ideas:

http://gist.github.com/281504

[+] bound008|15 years ago|reply
This tool looks awesome. For some of us, it's the first time at the running 20 EC2 instances at once rodeo, and a tool like this is helpful for testing and developing the parallelization and maintenance tasks that everyone else is being condescending about.
[+] ajslater|15 years ago|reply
screen. worked well for 200 machines.

  #!/bin/bash
  if [[ "$1" = "-n" ]]; then
    DETACH=
    shift;
  else
    DETACH="screen -d -m"
  fi

  for i in $NODES; do
    echo $DETACH ssh $i $@
    $DETACH ssh $i $@
  done;
[+] 9999|15 years ago|reply
I use csshx, and I highly recommend it. One annoyance is that on password entry screens it occasionally does not show the password prompt. But generally speaking it's a great utility.
[+] flexd|15 years ago|reply
You should be using key authentication anyway so that shouldn't be a problem :-)
[+] zackb|15 years ago|reply
I've been using this tool for about a year and absolutely love it. It really comes in handy managing messes of EC2 instances.
[+] aastaneh|15 years ago|reply
I use pdsh for this sort of thing.
[+] hoprocker|15 years ago|reply
This is nice as a proof-of-concept. Now it needs to become a patched version of Gnu screen.