我有1000倍Ubuntu 16集装箱运行在码头压力测试,一个软件,我们正在测试。
我可以一次一个地进入这些盒子里.但是我正在寻找一种方法来自动化这个内部僵尸网络的命令和控制。是否有命令行镜像工具?类似于键入命令sudo shutdown -r now或sudo service myService restart并从所有1000x终端获得响应.即使它只是命令的返回代码?
到目前为止,我已经调查了:
发布于 2017-02-02 21:26:48
PSSH提供OpenSSH和相关工具的并行版本。包括pssh、pscp、prsync、pnuke和pslurp。该项目包括psshlib,它可以在自定义应用程序中使用。源代码是用Python编写的,可以从以下地方克隆:
git克隆http://code.google.com/p/parallel-ssh/
Python2.4和更高版本(包括Python3.1及更高版本)支持PSSH。它最初是Brent N. Chun编写和维护的。由于日程繁忙,布伦特于2009年10月将维修工作移交给安德鲁·McNabb。
Usage: pssh [OPTIONS] command [...]
Options:
--version show program's version number and exit
--help show this help message and exit
-h HOST_FILE, --hosts=HOST_FILE
hosts file (each line "[user@]host[:port]")
-H HOST_STRING, --host=HOST_STRING
additional host entries ("[user@]host[:port]")
-l USER, --user=USER username (OPTIONAL)
-p PAR, --par=PAR max number of parallel threads (OPTIONAL)
-o OUTDIR, --outdir=OUTDIR
output directory for stdout files (OPTIONAL)
-e ERRDIR, --errdir=ERRDIR
output directory for stderr files (OPTIONAL)
-t TIMEOUT, --timeout=TIMEOUT
timeout (secs) (0 = no timeout) per host (OPTIONAL)
-O OPTION, --option=OPTION
SSH option (OPTIONAL)
-v, --verbose turn on warning and diagnostic messages (OPTIONAL)
-A, --askpass Ask for a password (OPTIONAL)
-x ARGS, --extra-args=ARGS
Extra command-line arguments, with processing for
spaces, quotes, and backslashes
-X ARG, --extra-arg=ARG
Extra command-line argument
-i, --inline inline aggregated output and error for each server
--inline-stdout inline standard output for each server
-I, --send-input read from standard input and send as input to ssh
-P, --print print output as we get ithttps://code.google.com/archive/p/parallel-ssh/
示例用法:
pssh -i -h hosts.txt echo "hello, world"https://askubuntu.com/questions/879125
复制相似问题