mmdsh command
Runs commands on multiple nodes or network connected hosts at the same time.
Synopsis
mmdsh -N {Node[,Node...] | NodeFile | NodeClass}
[-l LoginName] [-i] [-s] [-r RemoteShellPath]
[-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.
- -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.
- -v
Verifies that a node is reachable with an ICMP echo command (network ping) before adding it 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. The default value is 64.
- Command
-
To be run on the remote hosts.
Exit status
The return code from this command does not reliably indicate the success or failure of the command that is executed on the remote node. To determine the overall command status, review the messages that are returned by the remote commands.
- 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