welcome to xlongwei.com

欢迎大家一起学习、交流、分享


QQ:9167702333 邮箱:admin@xlongwei.com

在tomcat下部署nexus和jtrac


分类 Server   关键字 分享   标签 tomcat   maven   发布 hongwei  1432544103315
注意 转载须保留原文链接,译文链接,作者译者等信息。  
nexus和jtrac都自带了jetty集成,当服务器内存较小时,在tomcat下部署nexus和jtrac会比较节省内存。

nexus独立部署
# wget http://tool.xlongwei.com/softwares/nexus-2.0.3-bundle.tar.gz
# tar zxvf nexus-2.0.3-bundle.tar.gz
# vi nexus/nexus-2.0.3/conf/nexus.properties
application-port=60000 #端口
nexus-webapp=${bundleBasedir}/nexus #nexus web content
nexus-webapp-context-path=/nexus #上下文
nexus-work=/usr/local/mvnrepos #设置工作目录

# nexus/nexus-2.0.3/bin/nexus start #运行nexus服务,访问host:60000/nexus即可

nexus部署到tomcat,复制nexus/nexus-2.0.3/nexus到tomcat/webapps即可
# wget http://tool.xlongwei.com/softwares/nexus.war           #war包分享出来了
# vi tomcat/webapps/nexus/WEB-INF/plexus.properties
nexus-work=/usr/local/mvnstores


maven的安装配置
# wget http://tool.xlongwei.com/softwares/maven.tar.gz
# cd /usr/local #建议将maven解压至此目录
# tar zxvf maven.tar.gz
# vi maven/conf/settings.xml
<localRepository>/usr/local/mvnrepos</localRepository> #mvn本地下载jar存储路径
<server>
<id>snapshots</id> #mvn deploy账户密码,有snapshots和releases配置
<username>admin</username>
<password>admin123</password>
</server>
<mirror>
<id>xlongwei</id>
<mirrorOf>*</mirrorOf>
<name>xlongwei</name> #优先从私服下载jar包
<!--<url>http://10.163.224.4:60000/nexus/content/groups/public/</url>-->
<url>http://nexus.xlongwei.com/content/groups/public/</url>
</mirror>

jtrac独立部署:jtrac.xlongwei.com测试账号,guest,密码test123-
# wget http://tool.xlongwei.com/softwares/jtrac-2.1.0.zip
# tar zxvf jtrac-2.1.0.zip
# vi jtrac/start.sh #配置端口,数据目录默认jtrac/data
setsid java -Djetty.port=60001 -Djtrac.home=data -Dfile.encoding=UTF-8 -DSTOP.PORT=8079 -DSTOP.KEY=jtrac -jar start.jar > /dev/null 2>&1 &

jtrac部署到tomcat,复制jtrac/jtrac.war到tomcat/webapps即可
# jar xvf jtrac/jtrac.war   #tomcat会自动解压war,也可以手动解压并删除war文件
# vi tomcat-base/webapps/jtrac/WEB-INF/classes/jtrac-init.properties #数据目录一定要备份好
jtrac.home=/soft/jtracdata

# vi /soft/shells/backup_jtracdata.sh
backup=/soft/backup/jtracdata
suffix=`date +%Y%m%d`
file=$backup/jtrac-$suffix.tar.gz
echo "backup jtrac data start at `date +'%Y-%m-%d %H:%M:%S'`"
echo "tar zcvf $file -C /soft/ jtracdata"
tar zcvf $file -C /soft/ jtracdata
echo "backup jtrac data end at `date +'%Y-%m-%d %H:%M:%S'`"