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 Python 2.4 or later versions
- 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
- Configure the ip.txt file
- The format is user@ip:port, one per line. Port 22 is used by default if "port" value is not specified.
- The sudo permission is required for running commands.
- The passwords for the machines for batch installation must be the same. You can also set password-less trust between the machines.
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"