版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yangguosb/article/details/88090201
作用
批量地在集群机器上执行命令,类似于pgm命令。另外,pdsh还附带了pdcp命令,此命令可以将本地文件批量复制到远程的多台主机上;
安装
yum install pdsh
用法
Usage: pdsh [-options] command ...
-S return largest of remote command return values
-h output usage menu and quit
-V output version information and quit
-q list the option settings and quit
-b disable ^C status feature (batch mode)
-d enable extra debug information from ^C status
-l user execute remote commands as user
-t seconds set connect timeout (default is 10 sec)
-u seconds set command timeout (no default)
-f n use fanout of n nodes //同时连接到远程机器的个数
-w host,host,... set target node list on command line //执行命令的机器列表
-x host,host,... set node exclusion list on command line //黑名单,排除掉的机器列表
-R name set rcmd module to name //指定使用的协议,如ssh、rsh等
-M name,... select one or more misc modules to initialize first
-N disable hostname: labels on output lines
-L list info on all loaded modules and exit
available rcmd modules: ssh,exec (default: ssh)
参考: