Linux Bulk Operations Pssh tool

Source: Internet
Author: User
Tags pscp

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 [...]

    • -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 other tools:

  • PSCP transfer files to multiple hosts, similar to SCP(PSCP tools are also often available)

    • Pscp-h host/root/host/root/#根据host文件下的主机IP地址, sent from the local/root/directory to the/root/directory of the destination IP

  • Pslurp copy files from multiple remote machines to local

  • Pnuke parallel in remote host kill process

    • Pnuke-h Hosts.txt-l irb2 Java

  • Prsync synchronizing from the local computer to a remote host using the Rsync protocol

    • Prsync-r-H hosts.txt-l irb2 Foo/home/irb2/foo




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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.