PDSH
July 14, 2017 | Linux ProvisioningPDSH is a an efficient, multithreaded remote shell client which executes commands on multiple remote hosts in parallel. PDSH implements dynamically loadable modules for extended functionality such as new remote shell services and remote host selection. In my humble option, PDSH has been largely superseded by Ansible, which can easily do everything PDSH can, and many more things that PDSH can’t.
Installing pdsh
PDSH package is available from the EPEL repository. To install pdsh on the admin node pulpos-admin:
Let’s do a quick test:
We can use the WCOLL
environment variable to specify a filename that lists the target nodes. For example, let’s create a file ~/pdsh/hosts
that lists all the hosts in the Pulpos cluster:
Then after setting the environment variable, we can simply run pdsh
:
Note PDSH package also includes 2 other tools: pdcp
& rpdcp
. pdcp
copies files to groups of hosts in parallel, while rpdcp
(reverse pdcp) copies files from a group of hosts in parallel.
dshgroup module
The dshgroup module allows pdsh to use dsh style group files from /etc/dsh/group/
or ~/.dsh/group/
. The default search path may be overridden with the DSHGROUP_PATH
environment variable, a colon-separated list of directories to search.
Install dshgroup module:
Create the directory /etc/dsh/group/
:
Create a group file (/etc/dsh/group/osd
) for the OSD nodes:
Test the osd
group: