![]() $ sudo dnf install clusterssh #Fedora 22+ $ sudo apt install clusterssh #Debian/Ubuntu To use clusterssh, start by installing it on your local Linux computer as shown. It launches an administration console and an xterm to all specified servers enabling you to run the same command on all of them. For more information, see the pdsh man page: $ man pdshĬlusterSSH is a command line tool for administering clusters of multiple servers at the same time. In case you do not specify a remote command to be executed on the command line as shown above, pdsh runs interactively, prompting you for commands and running them when terminated with a carriage return. Pdsh – Execute Commands in Multiple Linux Servers Take note of the ^ before the hosts file. Then run pdsh as shown the flag -w is used to specify the hosts file, and -R is used to specify the remote command module (available remote command modules include ssh, rsh, exec, the default is rsh). To run commands on multiple servers, add the servers to a hosts file as explained before. To install Pdsh on your Linux machines, run the appropriate command below. It employs a sliding window of threads to execute remote commands. Pdsh is an open source, simple parallel remote shell tool for executing commands on multiple Linux servers at the same time. You should also check out: How to Run Multiple Commands on Multiple Linux Servers 2. Pssh Run Commands on Multiple Linux Servers The -i flag means display std output and std error as execution of the command on each server completes. Now run parallel-ssh, specify the hosts file using the -h option and a command(s) that will be executed on all the specified servers. # dnf install python-pip python-setuptools #Fedora 22+ # yum install python-pip python-setuptools #RHEL/CentOS $ sudo apt install python-pip python-setuptools #Debian/Ubuntu To install parallel-ssh, you need to first install PIP on your Linux system. It contains a number of tools for various purposes such as parallel-ssh, parallel-scp, parallel-rsync, parallel-slurp and parallel-nuke (read the man page of a particular tool for more information). Parallel-SSH is an open source, fast and easy-to-use command line based Python toolkit for executing ssh in parallel on a number of Linux systems. ![]() Read Also: How to Configure Custom SSH Connections to Simplify Remote Access 1. This above all enhances server security and also enables ease of access. This guide is useful for system administrators who usually have to check the health of multiple Linux servers everyday.įor the purpose of this article, we assume that you already have SSH setup to access all your servers and secondly, when accessing multiple servers simultaneously, it is appropriate to set up key-based password-less SSH on all of your Linux servers. We will explain how to use some of the widely known tools designed to execute repetitive series of commands on multiple servers simultaneously. In this article, we will show how to run commands on multiple Linux servers at the same time.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |