当前位置:   article > 正文

nexus 安装 配置 启动,配置开机自启动_sonatype nexus 自启动

sonatype nexus 自启动

一、nexus 安装 配置 启动

安装 JDK8

运行 Nexus 需要 Java 8 的运行时环境支持,可以使用 YUM 方式安装安装 open JDK1.8版本,也可以使用 rpm 安装

我们课程使用 RPM 方式安装

[root@node src]# rpm -ivh jdk-8u121-linux-x64.rpm
  • 1

java安装成功

[root@node src]# java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
  • 1
  • 2
  • 3
  • 4

Nexus 安装包地址
下载地址:https://www.sonatype.com/download-oss-sonatype

安装 Nexus

[root@node src]# mv nexus-3.13.0-01-unix.tar.gz /usr/local/
  • 1

解压

[root@node src]# cd /usr/local/
[root@node local]# tar -xf nexus-3.13.0-01-unix.tar.gz 
  • 1
  • 2

解压出两个文件夹

[root@node local]# ll
total 120028
drwxr-xr-x. 2 root root         6 Apr 11  2018 bin
drwxr-xr-x. 2 root root         6 Apr 11  2018 etc
drwxr-xr-x. 2 root root         6 Apr 11  2018 games
drwxr-xr-x. 2 root root         6 Apr 11  2018 include
drwxr-xr-x. 2 root root         6 Apr 11  2018 lib
drwxr-xr-x. 2 root root         6 Apr 11  2018 lib64
drwxr-xr-x. 2 root root         6 Apr 11  2018 libexec
drwxr-xr-x  9 root root       163 Apr 23 00:39 nexus-3.13.0-01 // nexus 程序
-rw-r--r--  1 root root 122904706 Dec 17  2018 nexus-3.13.0-01-unix.tar.gz
drwxr-xr-x. 2 root root         6 Apr 11  2018 sbin
drwxr-xr-x. 5 root root        49 Aug 24  2019 share
drwxr-xr-x  3 root root        20 Apr 23 00:39 sonatype-work // 仓库的工作文件夹
drwxr-xr-x. 2 root root        37 Apr 23 00:38 src
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

改名字:

[root@node local]# mv nexus-3.13.0-01 nexus
[root@node local]# ll
total 120028
drwxr-xr-x. 2 root root         6 Apr 11  2018 bin
drwxr-xr-x. 2 root root         6 Apr 11  2018 etc
drwxr-xr-x. 2 root root         6 Apr 11  2018 games
drwxr-xr-x. 2 root root         6 Apr 11  2018 include
drwxr-xr-x. 2 root root         6 Apr 11  2018 lib
drwxr-xr-x. 2 root root         6 Apr 11  2018 lib64
drwxr-xr-x. 2 root root         6 Apr 11  2018 libexec
drwxr-xr-x  9 root root       163 Apr 23 00:39 nexus
-rw-r--r--  1 root root 122904706 Dec 17  2018 nexus-3.13.0-01-unix.tar.gz
drwxr-xr-x. 2 root root         6 Apr 11  2018 sbin
drwxr-xr-x. 5 root root        49 Aug 24  2019 share
drwxr-xr-x  3 root root        20 Apr 23 00:39 sonatype-work
drwxr-xr-x. 2 root root        37 Apr 23 00:38 src
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

启动nexus
上面启动成功后会警告不要使用 root 用户启动,这里可以新建一个用户,也可以指定
root 用户启动,使他不出现警告,

下面配置指定 root 用户启动,编辑 bin 目录下的 nexus.rc 启动配置文件

[root@node bin]# cat nexus.rc 
#run_as_user=""
[root@node bin]# pwd
/usr/local/nexus/bin
[root@node bin]# vim nexus.rc 
  • 1
  • 2
  • 3
  • 4
  • 5

修改内容为:

run_as_user=“root”

然后wq!保存

可以这样使用

[root@node bin]# ./nexus 
WARNING: ************************************************************
WARNING: Detected execution as "root" user.  This is NOT recommended!
WARNING: ************************************************************
Usage: ./nexus {start|stop|run|run-redirect|status|restart|force-reload}
  • 1
  • 2
  • 3
  • 4
  • 5

启动nexus 启动成功

[root@node bin]# /usr/local/nexus/bin/nexus start
WARNING: ************************************************************
WARNING: Detected execution as "root" user.  This is NOT recommended!
WARNING: ************************************************************
Starting nexus
[root@node bin]# /usr/local/nexus/bin/nexus status
WARNING: ************************************************************
WARNING: Detected execution as "root" user.  This is NOT recommended!
WARNING: ************************************************************
nexus is running.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

在浏览器访问 http://IP:8081
登录下

默认用户名admin

密码默认是admin123

安装路径查找命令 find / -name log.log

二、CentOS7配置nexus开机自启动

https://www.cnblogs.com/vitoboy/p/12657581.html

参考: https://www.cnblogs.com/mingerlcm/p/12757804.html
https://blog.csdn.net/LUSILIN11/article/details/78970940

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/124713
推荐阅读
相关标签
  

闽ICP备14008679号