mmdsh command
Runs commands on multiple nodes or network connected hosts at the same time.
Synopsis
mmdsh -N {Node[,Node...] | NodeFile | NodeClass}
[-l LoginName] [--ignoreSignal {Signal[Signal...]}]
[-i] [-s] [-r RemoteShellPath] [-I {"File[;File]"}
[-d]][-v[-R ReportFile]] [-f FanOutValue] Command
Availability
Available on all IBM Spectrum Scale™ editions.
Description
Use the mmdsh command to remotely execute a command concurrently on each of the nodes that are specified in the -N option.
Parameters
- -N {Node[,Node...] | NodeFile | NodeClass}
-
Runs the command on the nodes in the given node specification. The nodespecification argument can be a comma-separated list of nodes, a node file, or a node class. The nodes in the list or the file can be specified as long or short admin or daemon node names, node numbers, node number ranges, or IP addresses.
- -l LoginName
-
Allows the user to specify a log-in name for the nodes. The log-in names are entered in the command line.
- --ignoreSignal {Signal[,Signal…]}
-
Rejects the listed signals.
- -i
-
Displays the set of nodes before the command is run on those nodes.
- -s
-
Suppresses the prepending of the hostname string to each line of output generated by running the command on the remote node.
- -r RemoteShellPath
-
Specifies the full path of the remote shell command that must be used.
- -I {"File[;File]"}
-
Name of the file to be copied on the remote node prior to executing the command. The file must be in /var/mmfs/tmp. Use this option to specify two files.
- -d
-
Removes the files specified with the -I flag before exiting.
- -v
-
Verifies that nodes are reachable before adding them to the set of nodes on which the command must be run.
- -R ReportFile
-
Reports the list of hosts removed from the working collective when host verification (host ping) fails. The report is written to the specified file with one host per line. The report is generated only when combined with the -v parameter.
- -f FanOutValue
-
Specifies a fanout value used for concurrent execution.
- Command
-
To be run on the remote hosts.
If the command is the reserved word _SELECT_FROM_FILE_, then the commands to be run on the different hosts are expected to be in the file pointed to by the environment variable mmdshCommandsFile. Each line of this file consists of hostname followed by a command string. If the command is the reserved word _NOOP_, then mmdsh is used to propagate files in parallel via the -I option.
Note: To determine the working collective, set the WCOLL environment variable that contains the host names (one name per line) where the commands must be executed, if it is not already obtained from the command line.
Exit status
- 0
- Successful completion.
- nonzero
- A failure has occurred.
Security
You must have root authority to run the mmdsh command.
The node on which the command is issued must be able to execute remote shell commands on any other node in the cluster without the use of a password and without producing any extraneous messages. For more information, see Requirements for administering a GPFS file system.
Example
- To run the command on a list of nodes specified in NodeFile, run
the following command:
mmdsh -N ./nodes uname –a
- To run the command on a specified list of hosts, run the following
command:
mmdsh -N host1,host2,host3 ls
- To run the command on the quorum nodes specified by a node class,
run the following command:
mmdsh -N quorumnodes date
- To run the command on the hosts listed in the hostfile, run the
following command:
mmdsh -N ./nodes -r /usr/bin/ssh uname –a
- To run the command on a specified node along with a log-in name,
run the following command:
mmdsh -N host -l admin ls