6 ms·
Cluster SSH (OSX)
- tlrobinson 16y agoNeat 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)
- JonnieCache 16y agoThis is surely the most elaborate excuse ever for not writing those maintenance scripts?
- ceejayoz 16y agoIt's great for those little tweaks like adding a symbolic link.
- ilikepi 16y agomeh... for h in host1 host2 host3; do \ echo -e "\n$h\n===========\n"; \ ssh $h 'ln -s /some/path /path/to/link && ls -l /path/to/link'; \ done edit: woops, left out a couple semicolons...
- geocar 16y ago> edit: woops Exactly. One-offs are easy to test interactively with cssh, and despite what anyone thinks, there are always one-offs in the real world.
- ilikepi 16y agoTrue. Usually when creating a shell loop like this, I prepend 'echo' in front of 'ssh...' as a dry run first. I also wouldn't actually use something like this for commands that are destructive in nature. Usually it's for things like running informational commands ('rpm -q', 'uptime', etc). Of course anything can become destructive if you fat-finger it hard enough. In short, use automation with care.
- fragsworth 16y agoFUCKING SERIOUSLY?! Thank you for this comment, I never knew you could pass commands to ssh.
- joh6nn 16y agoi suggest perusing the ssh man, then, as it seems likely that it has other capabilities you don't know about.
- rbranson 16y agoLike how SSH agent forwarding can allow you to hop from box to box with the SSH keys loaded onto your local machine's SSH agent? Found that one a few months ago, made me reflect on what I've been doing in life the past 10 years not thoroughly reading UNIX man pages.
- erikig 16y agoThanks for this one. You just added a few days to my life and helped push out the onset of carpal tunnel/arthritis. ~ http://www.unixwiz.net/techtips/ssh-agent-forwarding.html http://www.unixwiz.net/techtips/ssh-agent-forwarding.html
- jberryman 16y agossh is magic. checkout -X for X11 forwarding to run remote GUI apps, and -R which lets you set up a reverse SSH tunnel when you need to connect to a machine behind a firewall.
- Raphael_Amiard 16y agosuch a polite version of RTFM, i love you
- taylorbuley 16y agoBased on a similar reaction a few months ago, this will definitely change the way you go about system work.
- 16y ago
- veritgo 16y agoYou probably already know this, but if you have a significant number of hosts: for i in `seq 1 30`; do \ echo -e "\nhost$i\n===========\n"; \ ssh host$i 'ln -s /some/path /path/to/link && ls -l /path/to/link'; \ done Also, if you just start typing for i in `seq 1 30` do commands more commands done On the command line itself, you don't need to worry about semicolons. Bash will take care of it.
- VMG 16y agoCould be worthwhile seeing when something goes wrong on one machine. It would be great to bundle all terminals that look the same though
- hinathan 16y agoWhy not just use dsh for this?
- rilindo 16y agoThis 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 16y agoOnly 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 16y agoCSSHX + sudo su is cruise control for cool.
- gooddelta 16y agoApril fools?
- elliottcarlson 16y agoThought so too - until I looked at the Update history...
- koenigdavidmj 16y agoWell, ClusterSSH (a version that runs on Linux and uses xterm instances) is one of my everyday administration tools. It's under 15 identical machines, so it is more trouble than it is worth to set up Puppet or something of that sort.
- seletz 16y agoOh my! I use fabric http://fabfile.org/ http://fabfile.org/ which is insanely easy to use. I use it even if I have one machine to deploy to. Better keep them deployments repeatable ...
- koenigdavidmj 16y agoStill, that makes me write a bit of Python. Not going to do that for a simple symlink change or one-off task of similar complexity.
- trafficlight 16y agoYou can actually do that with Fabric, too. fab -H system1,system2,system3 -- uname -a
- rch 16y agoYes... April Fools.
- dacort 16y agoReminds me of Tentakel. http://sourceforge.net/projects/tentakel/files/tentakel/tentakel-2.2/ http://sourceforge.net/projects/tentakel/files/tentakel/tent... Came in useful from time-to-time.
- zackb 16y agoI've been using this tool for about a year and absolutely love it. It really comes in handy managing messes of EC2 instances.
- techscruggs 16y agoiterm's "send input to all tabs" does this rather well.
- th0ma5 16y agognu 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 http://gist.github.com/281504
- aastaneh 16y agoI use pdsh for this sort of thing.
- lg 16y agoi do something like this with multiple shell buffers and an emacs macro that pastes what i just wrote and hits enter in every buffer.
- 9999 16y agoI 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 16y agoYou should be using key authentication anyway so that shouldn't be a problem :-)
- swah 16y agoThis should look great in movies.
- brush 16y agoiTerm2 has this feature with a much nicer layout. http://www.iterm2.com http://www.iterm2.com
- hoprocker 16y agoThis is nice as a proof-of-concept. Now it needs to become a patched version of Gnu screen.
- bound008 16y agoThis 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.
- viralinfection 16y agoPersonally, I still use Visor without trouble
- mccutchen 16y agoThis 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.
- drx 16y agoCluster 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 16y agoisn't ejecting cd trays so, like, 90's :) glad my mac book doesn't have one!
- taylorbuley 16y agoIf you run rm -r / you'll learn where they got the name "cluster" from
- ez77 16y agotmux 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!
- res0nat0r 16y agoAlso I'd recommend kanif: http://taktuk.gforge.inria.fr/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 16y agoMany 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!
- scottm01 16y agoI 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 16y agoNow that <a href="http://devstructure.com>blueprint</a> 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.
- technomancy 16y agoCluster SSH is also a tool for Emacs: http://www.emacswiki.org/emacs/ClusterSSH http://www.emacswiki.org/emacs/ClusterSSH
- ajslater 16y agoscreen. 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;
- tomkinstinch 16y agoThanks; it's always nice to learn of another option. I've been using sshpt and pssh for this sort of thing: http://code.google.com/p/sshpt/ http://code.google.com/p/sshpt/ http://code.google.com/p/parallel-ssh/ http://code.google.com/p/parallel-ssh/
- deleted 16y ago[deleted]
- stretchwithme 16y agogood stuff. can it also compare the response of each and report which one of these is not like the others?
- TheRealGL 16y agoDoes this mean that doing rm -Rf as root mean that one is technically "clusterfucked"?