0

I'm using Windows to connect via SSH to my Amazon EC2 machines.

Is there a tool like Cluster SSH for Windows?

My goal is that I can connect via SSH to several EC2 machines and send each machine the same command at the same time, i.e. writting the command once and it should be send to several EC2 machines. Moreover, I would like to open several connections to one EC2 machines, in the case one connections breaks.

How can this be achieved using Windows as host? The EC2 machines use Ubuntu.

1
  • You should strongly consider taking a look at Ansible.
    – ceejayoz
    Oct 12, 2014 at 15:17

4 Answers 4

0

It sounds like what your asking for is configuration management / orchestration. There are a number of different orchestration engines out there.

The most "AWS" solution is to use OpsWorks, which is powered with chef. You can write a recipe (which might include one or more shell commands) and execute it on multiple instances either manually, or whenever a certain event occurs such as an instance starting or an application deployment.

Another alternative is ansible, which is similar except it operates exclusively over SSH.

0

I usually do this on Linux using tmux and synchronizing panes, with the option

:setw synchronize-panes

See also: http://blog.sanctum.geek.nz/sync-tmux-panes/

tmux is a terminal multiplexer, so you can also use it to open multiple connections to the same machine, like you asked.

According to this thread you should be able to install tmux on cygwin (there are also other intersting options in the thread): https://stackoverflow.com/questions/5473384/terminal-multiplexer-for-microsoft-windows-installers-for-gnu-screen-or-tmux

0

Instead of administering your cluster from your Windows client machine (with possibly unreliable connection), I would recommend to connect to a "master node" from which you'll send commands to slave nodes.

From this master node, you have a bunch of options to send distributed shell commands (clusterssh, dsh, pdsh, ... to name a few but there are many others)

0

ssh is always easiest from the command line. For Windows, use cygwin.

for i in 54.76.246.226 54.77.110.237 54.77.60.144; do ssh -i ~/.ssh/id_rsa root@$i 'uname -a'; done

or for lots of servers

for i in `echo hosts.txt`; do ssh -i ~/.ssh/id_rsa root@$i 'uname -a'; done

Make sure you use a private key that is in your keychain, or a key without a passphrase, so that you are not prompted for your passphrase for each host.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .