maven私服nexus搭建

一.搭建环境

   centos6.7

二.安装包下载

   1.下载地址

   https://help.sonatype.com/repomanager3/download/download-archives---repository-manager-3

   maven私服nexus搭建

 三.安装

     上传nexus-3.12.1-01-unix.tar.gz 到centos    /usr/local/下

      解压

      tar -zxvf nexus-3.12.1-01-unix.tar.gz

maven私服nexus搭建   

重命名目录 nexus-3.12.1-01

mv nexus-3.12.1-01 nexus

进入目录nexus,修改配置文件

/usr/local/nexus/etc

vim nexus-default.properties

修改端口号为8282,保存退出

maven私服nexus搭建

 如部署在外网下,需开放8282端口

vim /etc/sysconfig/iptables

添加8282端口

maven私服nexus搭建

因为我这里是内网访问,所以可以不用配置

四.启动和使用

cd /usr/local/nexus/bin/

./nexus start

 maven私服nexus搭建

不建议使用root用户启动,这里我们重新添加用户用户组。

首先杀死服务,查找进程

ps aux| grep nexus

maven私服nexus搭建

kill -9 12833

 添加nexus用户及用户组

useradd nexus

将目录权限更改为nexus用户

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

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

查看目录归属

maven私服nexus搭建

切换用户

su nexus

启动

./nexus/bin/nexus start

nohup ./bin/nexus run & 

查看进程

ps aux|grep nexus

maven私服nexus搭建

启动成功

 

访问:http://172.16.80.43:8282/

 

maven私服nexus搭建

五.使用默认用户名密码登陆 

    admin/admin123

    maven私服nexus搭建

maven私服nexus搭建

maven私服nexus搭建

修改文件句柄数

vim /etc/security/limits.conf

增加配置

* soft nofile 65536
* hard nofile 65536

maven私服nexus搭建

配置开机启动

vim /etc/rc.local

增加

su nexus -c 'nohup /usr/local/nexus/bin/nexus run &'

maven私服nexus搭建

重启