标签:pssh tomcat
ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.3.2
tar -xvf pssh-2.3.1.tar.gz
cd pssh-2.3.1
python setup.py install
创建所有服务器列表txt文件allhosts vim allhosts>>192.168.3.1-15
创建java目录
pssh -i -h allhosts "mkdir /usr/local/java"
拷贝jdk文件到所有服务器
pscp -h allhosts jdk-7u45-linux-x64.tar.gz /usr/local/java
解压jdk目录
pssh -i -h allhosts "tar -zxvf /usr/local/java/jdk-7u45-linux-x64.tar.gz -C /usr/local/java"
环境变量生效
pssh -i -h /root/allhosts "source /etc/profile"
查看java是否生效
pssh -i -h /root/allhosts "java -version"
拷贝tomcat安装包
pscp -h allhosts apache-tomcat-7.0.77.tar.gz /usr/local/java
解压tomcat
pssh -i -h allhosts "tar -zxvf /usr/local/java/apache-tomcat-7.0.77.tar.gz -C /usr/local/java/"
启动tomcat服务
pssh -i -h allhosts "/usr/local/java/apache-tomcat-7.0.77/bin/startup.sh"
查看服务是否启动
pssh -i -h allhosts "netstat -antup | grep 80"
标签:pssh tomcat
原文地址:http://12185273.blog.51cto.com/12175273/1979036