Centos7安装nexus3

下载

下载地址
直接下载地址
也可以wget https://download.sonatype.com/nexus/3/latest-unix.tar.gz
下载unix版本。

上传到服务器

SSH命令传输文件

安装&启动

默认已经安装了JDK。
我看了网上很多资料都是安装到/use/local/目录下,** 我 偏 不 **
我这里解压到/home目录下

1
2
3
4
5
6
7
8
9
10
mkdir /home/nexus
tar -zxvf nexus-3.15.1-01-unix.tar.gz -C /home/nexus/
mv nexus-3.15.1-01 nexus3
cd nexus3/bin
./nexus start
# 这里报错
WARNING: ************************************************************
WARNING: Detected execution as "root" user. This is NOT recommended!
WARNING: ************************************************************
Usage: ./nexus {start|stop|run|run-redirect|status|restart|force-reload}

这里用root用户操作所以出现警告,可以在环境变量中添加export RUN_AS_USER=root解决。

1
2
3
sudo vim  /etc/profile
#最后添加变量
source /etc/profile

这里还有一个文件nexus3/bin/nexus.rc,文件中恰巧是run_as_user="",这里不再修改尝试了。

重新启动

1
2
3
ps -ef |grep nexus
#如果有运行的nexus 则kill 掉
./nexus start

然后就可以访问了,默认端口8081.

查看密码
1
cat /home/nexus/sonatype-work/nexus3/admin.password

修改IP、端口、访问根目录,文件

1
2
vim /home/nexus3/etc/nexus-default.properties 
vim /home/nexus3/bin/nexus.vmoptions

登录

右上角登录,
默认用户名为admin,密码admin123
登录之后点击有上角admin进入信息管理界面可以修改密码。

本文地址 Centos7安装nexus3

本文地址: https://github.com/maxzhao-it/blog/post/36180/