maven之nexus1.9私服安装及性能优化

本文详细介绍了Nexus服务器的安装步骤、配置方法及定时任务设置,包括使用tomcat作为服务器、部署Nexus WAR包、调整性能参数、配置定时任务以优化工作效率,并提供了maven客户端的配置指南。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

[size=xx-large]介绍[/size]
nexus的服务器有2个版本

1.集成web应用服务器版本,用的是jetty

2.war包版本,我们可以自己部署在WEB应用服务器上

3.服务器地址

nexus.mgt.pangu365.com:80 --> 10.10.160.243:8080

注:使用IP地址,在服务器发生故障的时候,服务器可能会迁移到其他IP,所以请尽量不要使用IP。

[size=xx-large]nexus安装[/size]
tomcat:7.0.34

服务器IP:10.10.160.243

服务器域名:http://nexus.mgt.pangu365.com

nexus:nexus-webapp-1.9.2.4.war



tomcat安装目录

/application/search/maven/apache-tomcat-7.0.34

nexus war部署路径

/application/search/maven/nexus-webapp-1.9.2.4

jar数据目录

/data0/search/nexus

apr与tomcat-native安装目录

/application/search/usr



修改nexus配置文件/application/search/maven/nexus-webapp-1.9.2.4/WEB-INF/plexus.properties如下

nexus-work=/data0/search/nexus
security-xml-file=${nexus-work}/conf/security.xml
application-conf=${nexus-work}/conf

runtime=${basedir}/runtime
apps=${runtime}/apps
webapp=${runtime}/apps/nexus/webapp
nexus-app=${runtime}/apps/nexus
runtime-tmp=${runtime}/tmp



修改tomcat的war部署位置,即:修改conf/server.xml

在Host节点下,增加

<Context path="/" docBase="/application/search/maven/nexus-webapp-1.9.2.4"/>

[size=xx-large]nexus的定时任务配置[/size]
选择Administration–>Scheduled Tasks 并添加以下任务

为了提高效率,不影响正常使用

任务在晚上0点开始运行,同时任务之间间隔半小时

[img]http://dl2.iteye.com/upload/attachment/0091/6561/1f213d31-c1b4-3ab3-bb1f-dd8848a05282.jpg[/img]


[size=xx-large]nexus的tomcat配置与性能测试[/size]
1 安装apr

参考tomcat优化与web压力测试

2 修改${TOMAT_HOME}/bin/catalina.sh

JAVA_OPTS="-Xmx16g -Xms16g -Xmn6g"





3 修改${TOMAT_HOME}/conf/server.xml

<Connector port="8080"
protocol="org.apache.coyote.http11.Http11AprProtocol"
connectionTimeout="20000"
URIEncoding="UTF-8"

maxPostSize="0"

useBodyEncodingForURI="true"
enableLookups="false"
maxHttpHeaderSize="1048576"
maxThreads="768"
minSpareThreads="128"
acceptCount="10240" />



4 压力测试结果,主要测试spring2.5.6(3169452 bytes)的下载

./ab -n 100000 -c 512 -H 'User-Agent: panguso_yace' 'http://10.10.160.243:8080/content/groups/public/org/springframework/spring/2.5.6/spring-2.5.6-sources.jar'


This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.10.160.243 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests


Server Software: Noelios-Restlet-Engine/1.1.6-SONATYPE-5348-V4
Server Hostname: 10.10.160.243
Server Port: 8080

Document Path: /content/groups/public/org/springframework/spring/2.5.6/spring-2.5.6-sources.jar
Document Length: 3169452 bytes

Concurrency Level: 512
Time taken for tests: 369.190 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Total transferred: 316999309694 bytes
HTML transferred: 316954708356 bytes
Requests per second: 270.86 [#/sec] (mean)
Time per request: 1890.253 [ms] (mean)
Time per request: 3.692 [ms] (mean, across all concurrent requests)
Transfer rate: 838510.33 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 1 10 1.8 10 64
Processing: 266 1879 77.4 1875 2732
Waiting: 8 17 44.9 12 849
Total: 276 1889 77.6 1885 2745

Percentage of the requests served within a certain time (ms)
50% 1885
66% 1897
75% 1905
80% 1911
90% 1926
95% 1947
98% 2022
99% 2184
100% 2745 (longest request)

[size=xx-large]maven客户端配置[/size]
修改${M2_HOME}/conf/setting.xml文件

里面mirrors里的节点

<mirror>
<id>nexus</id>
<mirrorOf> * </mirrorOf>
<url>http://nexus.mgt.pangu365.com/content/groups/public/</url>
</mirror>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值