Pssh batch host Management

Source: Internet
Author: User
Tags pscp

Pssh Batch Management host pssh installation: # yum install * python * # tar zxvf pssh-1.4.3.tar.gz # cd pssh-1.4.3 # python setup. py install pssh usage: 1> # Batch Execute the hostname command # pssh-h other.txt-l root-I hostname 2> # batch copy the local file nrpe. tgz to remote server # pscp-h other.txt-l root/home/soft/nrpe. tgz/usr/local/3> examples of other commands: pscp [root @ lnamp ~] # Pscp-h server.txt-l root test.txt/tmp/test.txt [1] 14:58:53 [SUCCESS] 192.168.8.50 [2] 14:58:53 [SUCCESS] 192.168.8.220 prsync [root @ lnamp ~] # Prsync-r-h server.txt-l root mongodb-linux-x86_64-2.0.5.tgz/tmp/[1] 14:56:45 [SUCCESS] 192.168.8.220 [2] 14:57:50 [SUCCESS] 192.168.8.50 pslurp [root @ lnamp ~] # Pslurp-r-h server.txt/tmp/authorized_keys/tmp/[1] 15:02:21 [SUCCESS] 192.168.8.220 [2] 15:02:21 [SUCCESS] 192.168.8.50 PS: pay attention to the following, /tmp/authorized_keys is a remote file! In this example, copy the/tmp/authorized file on the remote server to the local/tmp/directory [root @ lnamp ~]. # Pslurp-r-h server.txt-L/tmp // etc/init. d init. d [1] 06:31:57 [SUCCESS] 192.168.8.50 [2] 06:31:58 [SUCCESS] 192.168.8.220 [root @ lnamp ~] # Ll/tmp/192.168.8. * // tmp/192.168.8.220/: total 4 drwxr-xr-x 2 root 4096 Jun 3 06:31 init. d/tmp/192.168.8.50/: total 4 drwxr-xr-x 2 root 4096 Jun 3 06:31 init. d. You can see that the directory name of the remote server IP address is in the tmp directory, and the specified directory name init is generated in this directory. d-r indicates that the recursive subdirectory-L option specifies the location of the subdirectory to be created/etc/init. d is the directory init on the remote server. d. Use pnuke, the directory name under the local directory specified by-L. Killing the pnuke process on multiple remote hosts in parallel is equivalent to running ssh host killall. The pnuke parameter is a mode. All processes running on the remote computer with the same name in this mode are killed. You can use this command to stop the same daemon on a group of servers. Root @ lnamp ~] # Pnuke-h server.txt-l root cron [1] 06:39:51 [SUCCESS] 192.168.8.50 [2] 06:39:52 [SUCCESS] 192.168.8.220 is the result of executing the killall cron command on the host specified in the server.txt file, where cron is
A cron-matched process can be killed if any word appears in the ps process! PS: for the usage of each command, you can view the help of each command, such as pssh -- help

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.