Linux Batch Management Server gadget--pssh

Source: Internet
Author: User

LinuxBulk Management Server Gadgets--psshFirst, Introduction

Pssh--Parallel SSH program

PSSH is a program for executing SSH in parallel on a number of hosts.  It provides features such as sending input to all of the processes, passing a password to SSH, saving output to files, and Timing out.

the simple understanding is that you can SSH , to operate a remote managed server in parallel.

Recommended, it is best to password-free login to all remotely managed servers, eliminating the hassle of entering passwords.

Second, installation

There are a lot of things on the internet Pssh the source of the installation, I will not introduce. The following describes my installation process, which is simple:

server operating system: Centos 6.5 x64 , itself Yum source, can be installed directly Pssh .

# yum-y Install Pssh

iii. usage and options

Pssh [Options ...] comand ...

Options:  

- H host_file       read hosts from the given host_file.    user

- H Host hostto be[email protected]]host[:p ORT], the default isUserto beRoot,Portto be A, can be omitted. Can be followed by multipleHost

- L User Specify the user for default access

- T Timeout Specify the time-out, in seconds

- o outdir Specify the save path for standard output information, note the path, not the file

- I. display standard output and standard error messages to the terminal

Command : Shell script or a Linux the action command

Iv. Examples(MansManual provides)

Connect to Host1 and Host2, and print ' Hello, world ' from each:

Pssh-i-H "host1 host2" echo "Hello, World"

Print "Hello, World" from each host specified in the file hosts.txt:

Pssh-i-H hosts.txt echo "Hello, World"

Run a command as root with a prompt for the root password:

Pssh-i-H hosts.txt-a-L root echo Hi

Run a long command without timing out:

Pssh-i-H hosts.txt-t 0 sleep 10000


v. Practical use of work1.Bulk upgrade of a server project

pssh-h host_file-o out_start_log_directory-l user "export bash_env=/etc/profile; Project Upgrade Script . Sh "


2.real-time monitoring of the server's project log to the specified folder

nohup pssh-h host_file-lroot-t 0-o out_log_directory "Tail-f Project Log Path "> Out_nohup_log_directory &


This article is from the "Hades Blog" blog, please be sure to keep this source http://hades02.blog.51cto.com/9768670/1722322

Linux Batch Management Server gadget--pssh

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.