I. Scenario Description:
at the same time to the thousands of servers to execute a command, copy a file, kill a process, etc., what is the simplification of operations management tools? In small-scale use I use a For loop, a large number, on the one hand is not sure whether the operation is successful, On the one hand, the FOR Loop statement has poor performance estimation and is not synchronous execution concurrently.
Two. Preparatory work
1. Download package: https://pypi.python.org/pypi/pssh/2.3.1
2. Unzip pssh-2.3.1.tar.gz, and install Pssh tool 650) this.width=650 ; "Src=" Https://s5.51cto.com/wyfs02/M00/8F/CA/wKiom1jsoqSjOC2XAAAWwhDW-JA322.png-wh_500x0-wm_3-wmp_4-s_ 3824832795.png "title=" capture. PNG "alt=" wkiom1jsoqsjoc2xaaawwhdw-ja322.png-wh_50 "/>
Three. How to use
Usage: PSSH [options] command [...]
such as [email protected]:229
-H Execute Command host, host format [email protected]:p ORT
The user name of the-L remote machine
-P One-time maximum allowable number of connections
-P output execution information at execution time
-O output Redirect to a file
-E Execution error redirected to a file
-T set command execution time-out
-a prompts for the password and passes the password to SSH (this parameter is also used if the private key also has a password)
-O set some options for SSH
-X Set SSH additional parameters, can be multiple, separate the space between the parameters
-X with-X, but only one parameter can be set
-I displays standard output and standard errors after each host has finished executing other tools:
PSCP transfer files to multiple hosts, similar to SCP(PSCP tools are also often available)
Pslurp copy files from multiple remote machines to local
Pnuke parallel in remote host kill process
Prsync synchronizing from the local computer to a remote host using the Rsync protocol
Above, if we feel that there is any problem, we can exchange, thank you!
This article is from the "Children's Blog" blog, please be sure to keep this source http://bingotcr.blog.51cto.com/11710314/1914973
Linux Bulk Operations Pssh tool