码迷,mamicode.com
首页 > 系统相关 > 详细

linux 使用pssh批量部署tomcat

时间:2017-11-05 01:11:49      阅读:194      评论:0      收藏:0      [点我收藏+]

标签: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"


linux 使用pssh批量部署tomcat

标签:pssh tomcat

原文地址:http://12185273.blog.51cto.com/12175273/1979036

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!