一、edu-service-user远程自动化部署
远程部署SSH服务器配置
远程部署配置
Connecting to 192.168.1.121:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
Last login: Sun Apr 3 00:09:23 2016 from 192.168.1.2
[root@edu-provider-01 ~]# users
yxq
[root@edu-provider-01 ~]# pwd
/home/yxq
[root@edu-provider-01 ~]# hostname
edu-provider-01
[root@edu-provider-01 ~]#
hudson远程部署前先删除edu-provider-01上的服务jar及lib
[root@edu-provider-01 user]# pwd
/home/yxq/edu/serivce/user
[root@edu-provider-01 user]# ls
dubbo-governance.log lib zookeeper.out
edu-service-user.jar logs
edu-service-user.pid service-user.sh
[root@edu-provider-01 user]# rm -rf lib/
[root@edu-provider-01 user]# rm -rf edu-service-user.jar
192.168.1.51服务器查看hudson构建
[root@yxq ~]# cd /root/HudsonHome/
[root@yxq HudsonHome]# cd jobs
[root@yxq jobs]# ls
edu-common edu-common-core edu-common-web edu-service-user
edu-common-config edu-common-parent edu-facade-user edu-web-boss
[root@yxq jobs]# cd edu-service-user
[root@yxq edu-service-user]# cd workspace
[root@yxq workspace]# cd target/
[root@yxq target]# pwd
/root/HudsonHome/jobs/edu-service-user/workspace/target
[root@yxq target]# cd ..
[root@yxq workspace]# pwd
/root/HudsonHome/jobs/edu-service-user/workspace
[root@yxq workspace]#
部署成功
部署成功后再看:
[root@edu-provider-01 user]# ls
dubbo-governance.log lib zookeeper.out
edu-service-user.jar logs
edu-service-user.pid service-user.sh
在DubboAdmin中查看
二、edu-web-boss远程自动化部署
Connecting to 192.168.1.131:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
Last login: Sun Apr 3 00:10:03 2016 from 192.168.1.2
[root@consume ~]# users
yxq
[root@consume ~]# pwd
/home/yxq
[root@consume ~]# hostname
consume
[root@consume ~]#
配置
[root@consume ~]# cd /usr/java/jdk1.7.0_45/
[root@consume jdk1.7.0_45]# pwd
/usr/java/jdk1.7.0_45
把tomcat7移到到指定用户的目录下,因为hudson中已经设置以/home/yxq目录开头的
[root@consume jdk1.7.0_45]# mv /usr/local/tomcat7 /home/yxq/tomcat7
[root@consume jdk1.7.0_45]# cd /home/yxq
[root@consume ~]# ls
tomcat7
[root@consume ~]# cd tomcat7/webapps/
[root@consume webapps]# ls
[root@consume webapps]#
[root@consume webapps]# cd ../bin
[root@consume bin]# vi restart.sh
[root@consume bin]# cat restart.sh
## java env
export JAVA_HOME=/usr/java/jdk1.7.0_45
export JRE_HOME=$JAVA_HOME/jre
## restart tomcat
/home/yxq/tomcat7/bin/shutdown.sh
sleep 3
rm -rf /home/yxq/tomcat7/webapps/edu-web-boss
/home/yxq/tomcat7/bin/startup.sh
构建成功
root@consume bin]# cd ../webapps/
[root@consume webapps]# ls
edu-web-boss edu-web-boss.war
在浏览器访问部署的工程
登录进去
tomcat7日志,查看Dubbo服务