we usually manage several servers, we can use SSH this simple and efficient management tool remote login to manage, let our work become easy, fast, however, if you want to manage hundreds of thousands of units? Even with a quick and easy tool like SSH, it can make people feel headaches, so is there a management tool that can manage N servers at the same time?
The answer, of course, is yes, and then we'll introduce a batch management tool that has a kindred vein with SSH.
PSSH
PSSH is a tool that can execute commands on multiple servers while supporting the copying of files, which is an excellent management software in the same kind of tool.
* Note: To use PSSH, you must configure the key authentication access on each server!!!
Next we will deploy this environment, one to experience it!!!
Download the installation:
Wget http://www.theether.org/pssh/pssh-1.4.3.tar.gz; CD pssh-1.4.3
Python setup.py Install
The installation is complete, is it simple?
If the following error occurs with Python setup.py install
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/72/EE/wKioL1XwB1fDegsmAAGPp_9wjKY585.jpg "title=" 01.png "alt=" Wkiol1xwb1fdegsmaagpp_9wjky585.jpg "/>
Please do not worry, this error is due to Python does not install setuptools This module, this is a third-party module, just download the installation can
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/EE/wKioL1XwCKHxNpQrAASAgl74zLE466.jpg "title=" 02.png "alt=" Wkiol1xwckhxnpqraasagl74zle466.jpg "/>
If an error occurs, simply add the--no-check-certificate, as follows
wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz --no-check-certificate
Tar zxvf setuptools-0.6c11.tar.gz
CD SETUPTOOLS-0.6C11
python setup.py build
python setup.py Install
and then jump back to pssh-1.4.3 Execute python setup.py install, complete
Environment deployment is complete, next we will learn how to use the
PSSH Package Installation 5 Utilities :
Pssh runs commands in parallel on multiple hosts.
The PSCP copies files to multiple hosts in parallel.
The Prsync effectively replicates files to multiple hosts in parallel through the Rsync protocol.
The pslurp copies files from multiple remote hosts to the central host in parallel.
Pnuke kills processes on multiple remote hosts in parallel
PSSH Related parameters:
Pssh running commands in parallel on multiple hosts
- H executes the command's list of remote hosts, file content format [[email protected]]host[:p ORT]
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
Remote execution:
Pssh-i-H list.txt ' df-h '
This article is from the "Ride a Pig to Travel" blog, please be sure to keep this source http://songqinglong.blog.51cto.com/7591177/1693236
PSSH automatic operation and maintenance