CentOS   发布时间:2022-04-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了CentOS 安装 SonaType Nexus Maven Repository以及旧库迁移大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

转载:http://www.cnblogs.com/zhangqingsh/archive/2013/03/14/2959301.html CentOS下安装SonaType Nexus: 1.1 下载SonaTYpe Nexus: cd /usr/local/src wget http://download.sonatype.com/nexus/oss/nexus-2.3.1-01-bundle
@H_944_7@

转载:http://www.cnblogs.com/zhangqingsh/archive/2013/03/14/2959301.html

  1. CentOS下安装SonaType Nexus:

1.1 下载SonaTYpe Nexus:

cd /usr/local/src

wget http://download.sonatype.com/nexus/oss/nexus-2.3.1-01-bundle.tar.gz

1.2 安装:

cd /usr/local/src

sudo cp nexus-2.3.1-01-bundle.tar.gz /usr/local

cd /usr/local

sudo tar xvzf nexus-2.3.1-01-bundle.tar.gz

ln -s nexus-2.3.1-01 nexus

cp nexus/bin/nexus /etc/init.d/nexus

cd /etc/init.d

chmod 755 /etc/init.d/nexus

1.3 创建nexus用户/用户组:

1.3.1 创建用户组:groupadd -g 104 nexus

1.3.2 创建用户:useradd -u 103 -g 104 -c “Neuxs Maven Repository” nexus

1.4 配置属性文件/权限:

1.4.1 配置/etc/init.d/nexus:

vi /etc/init.d/nexus (修改如下变量)

复制代码

Set this to the root of the Nexus installation

NEXUS_HOME=”/usr/local/nexus”

NOTE - This will set the user which is used to run the Wrapper as well as

the JVM and is not useful in situations where a privileged resource or

port needs to be allocated prior to the user being changed.

RUN_AS_USER=nexus
复制代码
1.4.2 配置/usr/local/nexus/conf/nexus.properties

vi /usr/local/nexus/conf/nexus.properties

复制代码

jetty section

application-port=8081
application-host=0.0.0.0
nexus-webapp=${BundleBasedir}/nexus
nexus-webapp-context-path=/

Nexus section

nexus-work= bundleBasedir/sonatypework/nexusrun@H_320_197@ti@H_496_203@me= {BundleBasedir}/nexus/WEB-INF

复制代码
1.4.3 配置/usr/local/nexus权限

chown -R nexus:nexus /usr/local/nexus

1.5 启动Nexus

1.5.1 启动:

cd /etc/init.d

chkconfig –add nexus

chkconfig –levels 345 nexus on

service nexus start

启动正常,会得到如下信息:

StarTing Nexus OSS… Started Nexus OSs.

1.5.2 监控

tail -f /usr/local/nexus/logs/wrapper.log

1.5.3 查看进程

ps -ef | grep nexus

获得类似如下进程:

nexus 15133 1 0 13:56 ? 00:00:00 /usr/local/nexus/bin/jsw/linux-x86-64/wrapper /usr/local/nexus/bin/jsw/conf/wrapper.conf wrapper.syslog.ident=nexus wrapper.pidfile=/usr/local/nexus/bin/jsw/linux-x86-64/nexus.pid wrapper.daemonize=TRUE
nexus 15135 15133 13 13:56 ? 00:00:21 java -Djava.library.path=bin/jsw/lib -classpath bin/jsw/lib/wrapper-3.2.3.jar:./lib/sisu-jetty8-1.4.2.jar:./lib/logBACk-core-1.0.7.jar:./lib/jetty-io-8.1.8.v20121106.jar:./lib/jetty-webapp-8.1.8.v20121106.jar:./lib/jetty-http-8.1.8.v20121106.jar:./lib/jetty-servlet-8.1.8.v20121106.jar:./lib/logBACk-classic-1.0.7.jar:./lib/jetty-server-8.1.8.v20121106.jar:./lib/appcontext-3.2.jar:./lib/jetty-xml-8.1.8.v20121106.jar:./lib/javax.servlet-3.0.0.v201112011016.jar:./lib/jetty-deploy-8.1.8.v20121106.jar:./lib/nexus-bootstrap-2.3.1-01.jar:./lib/jetty-conTinuation-8.1.8.v20121106.jar:./lib/jetty-security-8.1.8.v20121106.jar:./lib/nexus-logging-extras-appender-2.3.1-01.jar:./lib/jetty-rewrite-8.1.8.v20121106.jar:./lib/slf4j-api-1.7.2.jar:./lib/jetty-util-8.1.8.v20121106.jar:./lib/plexus-interpolation-1.15.jar:./lib/jetty-jmx-8.1.8.v20121106.jar:./conf/ -Dwrapper.key=3C3oeOSu3AweFCPW -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.pid=15133 -Dwrapper.version=3.2.3 -Dwrapper.native_library=wrapper -Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1 org.sonatype.nexus.bootstrap.jsw.JswLauncher ./conf/jetty.xml

  1. 配置Nginx:

vi /etc/Nginx/Nginx.conf,加入如下server:

复制代码
server{
listen 80;
server_name 192.168.xxx.xxx; (服务器IP或者DNS域名)
#charset koi8-r;
#access_log logs/host.access.log main;

LOCATIOn / {
       proxy_read_timeout 120;
       proxy_send_timeout 120;
       proxy_connect_timeout 120;
       proxy_set_header  X-Real-IP  $remote_addr;
       proxy_set_header  X-ForWARDed-For $proxy_add_x_forWARDed_for;
       proxy_set_header Host $http_host;
       proxy_redirect off;
       proxy_pass http://localhost:8081;      
    }

    error_page  404              /404.html;
    LOCATIOn = /404.html {
        root   /usr/share/Nginx/html;
    }
    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    LOCATIOn = /50x.html {
        root   /usr/share/Nginx/html;
    }
}

复制代码
service Nginx restart

  1. 登录 Sonatype Nexus

http://192.168.XXX.XXX

4.旧库迁移(Nexus 到 Nexus)

旧库迁移其实非常简单,只需要将旧的库文件拷贝到新库对应位置,然后repair index就可以了。如:

将旧库的“/usr/local/nexus/sonatype-work/nexus/storage/releases”文件夹覆盖到新库的“/usr/local/nexus/sonatype-work/nexus/storage/releases”,然后“repair index”(需要花费一点时间),就可以了。

https://support.sonatype.com/entries/21602547-How-do-I-migrate-an-existing-repository-to-Nexus-

4.旧库迁移(其他仓库到 Nexus)

官网有详细的描述:http://www.sonatype.com/books/nexus-book/reference/migrating.html

大佬总结

以上是大佬教程为你收集整理的CentOS 安装 SonaType Nexus Maven Repository以及旧库迁移全部内容,希望文章能够帮你解决CentOS 安装 SonaType Nexus Maven Repository以及旧库迁移所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。