Genders and PDSH
Genders provides a simple method for categorising a node inventory. To learn more about genders, read the official tutorial.
PDSH provides a CLI tool for performing commands on multiple nodes at once, utilising the data stored in genders. To learn more about using PDSH, read the manual page for the command
Installing Genders and PDSH
The packages should be available in the package manager for your distribution. To install on CentOS/RHEL/Rocky:
dnf install pdsh genders
You will need
sudo permissions to install packages, see becoming the root user for more information
Creating a Genders File
Open the genders file (
/etc/genders) with your preferred text editor and add a gender in with the following format:
There are alternate formats that make writing a gender easier:
After adding the desired gender(s), save and close the file.
Finding the Names of Your Compute Nodes
In best practice, the hostnames of compute nodes usually follow a sequential order (e.g. node01, node02, node03... node10).
Users can find the names of their compute nodes by using the
nodeattr command with a group; e.g.
nodeattr -s nodes
nodeattr -c group
nodeattr -n groups
Users can run a command across many hosts at once using the pdsh command. This can be useful if users want to make the same change to multiple systems in the research environment - for example, installing a new software package. The
pdsh command can take a number of parameters that control how commands are processed; for example:
pdsh -g all uptime
pdsh -g nodes 'sudo yum -y install screen'
pdsh -g nodes -f 1 df -h /tmp
pdsh -w node01,node03 which ldconfig