持续集成交付CICD:CentOS 7 安装 Nexus 3.63

目录

一、实验

1.CentOS 7 安装Nexus3.63

二、问题

1.安装Nexus报错

2.Nexus启动停止相关命令


一、实验

1.CentOS 7 安装Nexus3.63

(1)当前操作系统版本&JDK版本

cat /etc/redhat-release

java -version

6895effc3b134bbf9228a4d7a1ceec84.png

(2)下载Nexus新版本

下载地址:https://help.sonatype.com/repomanager3/product-information/download
官方网址:https://www.sonatype.com/

(3)解压下载文件

tar xf nexus-3.63.0-01-unix.tar.gz 

(4)查看文件

[root@tomcat opt]# ll
总用量 408776
……
drwxr-xr-x  10 nexus nexus       181 12月  8 08:32 nexus-3.63.0-01
……
drwxr-xr-x   3 nexus nexus        20 12月  8 08:32 sonatype-work



# nexus-3.63.0-01	Nexus 运行所需要的文件,如运行脚本,依赖jar包等
# sonatype-work	该目录包含Nexus生成的配置文件、日志文件、仓库文件等

8b829ad973384ea4ba3399e7774de57e.png

(5)启动Nexus

 cd /opt/nexus-3.63.0-01/bin/
 
 ./nexus run &

#如果出现如下表示启动成功
-------------------------------------------------
 
Started Sonatype Nexus OSS 3.63.0-01
 
-------------------------------------------------

0034519bfb7c43008e49f07510e1e814.png
(6)查看密码,然后进入系统

#登录用户名是admin,初始密码位置在指定目录查看
cat /opt/sonatype-work/nexus3/admin.password

#远程访问
http://192.168.204.13:8081

#或本地访问 
http://127.0.0.1:8081

#远程访问防火墙可能会拦截,本地测试可以先把防火墙禁用
systemctl status firewalld.service
systemctl stop firewalld.service
systemctl disable firewalld.service
 

5dce4fa566be489184b7483d289494b0.png

(7) 登录系统

187252599ba14c47a41319df14138a6b.png

 (8)修改密码

23a4cd4a1c6a453fa507cc224e93debe.png

(9) 先设置允许匿名访问

f30b9093b2564208b7258044efd71948.png

 (10)登录成功

1b9a339e87554516abc3fc13d3517e91.png

(11)优化配置

#设置开机自启
ln -s /opt/nexus-3.63.0-01/bin/nexus /etc/init.d/nexus3
chkconfig --add nexus3
chkconfig nexus3 on
 
#配置运行用户
useradd nexus
vim nexus.rc
 
run_as_user="nexus"
 
#配置之后记得更改目录权限,否则下次启动会没有权限。
chown -R nexus.nexus nexus-3.39.0-01
chown -R nexus.nexus sonatype-work/
 
配置jdk
cat nexus

#!/bin/sh
# chkconfig:         2345 75 15
# description:       nexus
### BEGIN INIT INFO
# Provides:          nexus
# Required-Start:    $local_fs $network $remote_fs $syslog $time
# Required-Stop:     $local_fs $network $remote_fs $syslog $time
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: nexus
### END INIT INFO
 
# Uncomment the following line to override the JVM search sequence
 INSTALL4J_JAVA_HOME_OVERRIDE=/usr/java/jdk1.8.0_201-amd64/bin/java
# Uncomment the following line to add additional VM parameters
# INSTALL4J_ADD_VM_PARAMS=


 
#修改端口(一般使用默认的,如果需要修改,则更改)
vim /root/nexus/nexus-3.39.0-01/etc/nexus-default.properties

设置开机自启

d02aac2553ab4b168b09c156b2fd63d1.png

配置JDK

ffb0cdc1d18e41adb282fa41aa8cbda6.png

bc7442a67d7c4420af7e693ab1a81b1f.png

ea6082221695482e99c85ef8ce111159.png

修改端口

054417d6749c446daa44520a1be9c73e.png

4e8e970081a54bd58bbc024c565be51f.png
 

(12)查看仓库

dc3e8b4465e04ded93bf462c54083235.png

(13)查看仓库配置

562bf2b79ba84d48ae0b71c7dcf4abd9.png

(14)系统调用远程库

38cafb6478f54223aa9e9fa21de09812.png

(15)组成员仓库

5234c49965774086b1f675005d0e1c89.png

二、问题

1.安装Nexus报错

(1)报错

d821e22e0e7c429fbc367ed28fc89d43.png

(2)原因分析

JVM需要1.8版本

(3)解决方法

因当前主机已安装JDK11的Sonarqube,需要更换一台JVM1.8的主机

fdc24433f72c43aaa1fc0cf3f46f868e.png

已更换:

8ca92d45145c4791831be2b5038b15c4.png

2.Nexus启动停止相关命令

(1)命令

$ ./nexus start
$ ./nexus restart
$ ./nexus stop
$ ./nexus run &
$ ./nexus status

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值