dsh manpage

Running the Same Command Over SSH to Multiple Servers in Parallel

If you manage multiple servers, or even just a few, this command might come in handy. It’s called dsh – distributed shell.  It acts very similar to the ssh command but will run the command to all servers you pass to it via the -m switch.  Distributed shell can run the commands simultaneously with a max threshold, or one at a time.

It might be installed already, if not you can install it easily.

Debian & Ubuntu Install

 

This example will restart the elasticsearch service on all these servers at the same time.

Example

 

See the man page for more useful options.