pssh Introduction

pssh is a batch execution tool written in Python, which is suitable for performing some repeated operations on 30 or fewer servers. For example, installing software, killing a process, or downloading a file.

Install CloudMonitor Agent on a single machine

bash -c "$(curl http://cloudmonitor-agent.oss-cn-hangzhou.aliyuncs.com/release/install.sh)"

Install CloudMonitor Agent on multiple machines using pssh

  • Install pssh

    1. Install Python 2.4 or later versions
    2. Install pssh
       wget https://pypi.python.org/packages/source/p/pssh/pssh-2.3.1.tar.gz
       tar zxf pssh-2.3.1.tar.gz
       cd pssh-2.3.1
       python setup.py install 
      
  • Configure the IP list and prepare the machines on which CloudMonitor is to be installed

    1. Configure the ip.txt file
    2. The format is user@ip:port, one per line. Port 22 is used by default if "port" value is not specified.
    3. The sudo permission is required for running commands.
    4. The passwords for the machines for batch installation must be the same. You can also set password-less trust between the machines.
  • Batch execution

    pssh -h ip.txt -A -i bash -c "$(curl http://cloudmonitor-agent.oss-cn-hangzhou.aliyuncs.com/release/install.sh)"

    -H host list file

    -A Manual password entry, no password mutual trust does not need this parameter

    -I executed the command

  • Check whether CloudMonitor has been installed successfully

    pssh -h ip.txt -A -i"/usr/local/cloudmonitor/wrapper/bin/cloudmonitor.sh status"