{channel.title!channel.name} - 楚淮公司周东林

linux搭建 Nexus Repository Manager

参考官方网站https://help.sonatype.com/repomanager3/installation/java-runtime-environment


这步查看百度搜索,安装JDK1.8配置环境变量

1.设置系统内核,这个是根据日志报警自己设置的

[root@linux238 jdk1.8.0_192-amd64]# vi /etc/security/limits.conf
添加下面参数
nexus    soft    nproc 2047
nexus            hard   nproc 16384
nexus            soft nofile 1024
nexus            hard nofile 65536
2.创建nexus运行账号
[root@linux238 ~]# useradd nexus
3.修改 bashrc 文件
 [nexus@linux238 ~]# vi ~/.bashrc添加
NEXUS_HOME="/opt/nexus-3.14.0-04"
4.设置运行用户 /opt/nexus-3.14.0-04/bin/nexus.rc
run_as_user="nexus"
5.创建快捷方式 ln -s /opt/nexus-3.14.0-04/bin/nexus /etc/init.d/nexus
 
6.添加为服务
[root@linux238 init.d]# cd /etc/init.d
[root@linux238 init.d]# chkconfig --add nexus
[root@linux238 init.d]# chkconfig --levels 345 nexus on
 
7.配置虚拟内存,以及工作路径(大概都能看懂,具体 查看官网这里是默认的)
[nexus@linux238 /]$ vi /opt/nexus-3.14.0-04/bin/nexus.vmoptions
-Xms1200M
-Xmx1200M
-XX:MaxDirectMemorySize=2G
-XX:+UnlockDiagnosticVMOptions
-XX:+UnsyncloadClass
-XX:+LogVMOutput
-XX:LogFile=../sonatype-work/nexus3/log/jvm.log
-XX:-OmitStackTraceInFastThrow
-Djava.net.preferIPv4Stack=true
-Dkaraf.home=.
-Dkaraf.base=.
-Dkaraf.etc=etc/karaf
-Djava.util.logging.config.file=etc/karaf/java.util.logging.properties
-Dkaraf.data=../sonatype-work/nexus3
-Djava.io.tmpdir=../sonatype-work/nexus3/tmp
-Dkaraf.startLocalConsole=false
 
8.修改端口(比较常用,默认端口8081)类似http://localhost:8081
 

[nexus@linux238 ~]$ cp /opt/nexus-3.14.0-04/etc/nexus-default.properties /opt/nexus-3.14.0-04/etc/nexus.properties
[nexus@linux238 ~]$ vi /opt//nexus-3.14.0-04/etc/nexus.properties
application-port=9999   //我的端口设置为9999

9.启动服务查看运行情况

[nexus@linux238 ~]$ service nexus start
Starting nexus

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name  
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1331/sshd          
tcp        0      0 0.0.0.0:8888                0.0.0.0:*                   LISTEN      1541/nginx         
tcp        0      0 127.0.0.1:45049             0.0.0.0:*                   LISTEN      14548/java         
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      1409/master        
tcp        0      0 0.0.0.0:443                 0.0.0.0:*                   LISTEN      1541/nginx         
tcp        0      0 0.0.0.0:8899                0.0.0.0:*                   LISTEN      1541/nginx         
tcp        0      0 0.0.0.0:9999                0.0.0.0:*                   LISTEN      14548/java 

 


浏览.发表于:2018-10-29 14:40:21