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

目录

一、实验

[1.CentOS 7 安装Nexus3.63](#1.CentOS 7 安装Nexus3.63)

二、问题

1.安装Nexus报错

2.Nexus启动停止相关命令


一、实验

1.CentOS 7 安装Nexus3.63

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

bash 复制代码
cat /etc/redhat-release

java -version

(2)下载Nexus新版本

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

(3)解压下载文件

bash 复制代码
tar xf nexus-3.63.0-01-unix.tar.gz 

(4)查看文件

bash 复制代码
[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生成的配置文件、日志文件、仓库文件等

(5)启动Nexus

bash 复制代码
 cd /opt/nexus-3.63.0-01/bin/
 
 ./nexus run &

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

(6)查看密码,然后进入系统

bash 复制代码
#登录用户名是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
 

(7) 登录系统

(8)修改密码

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

(10)登录成功

(11)优化配置

bash 复制代码
#设置开机自启
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

设置开机自启

配置JDK

修改端口

(12)查看仓库

(13)查看仓库配置

(14)系统调用远程库

(15)组成员仓库

二、问题

1.安装Nexus报错

(1)报错

(2)原因分析

JVM需要1.8版本

(3)解决方法

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

已更换:

2.Nexus启动停止相关命令

(1)命令

bash 复制代码
$ ./nexus start
$ ./nexus restart
$ ./nexus stop
$ ./nexus run &
$ ./nexus status
相关推荐
青靴1 天前
轻量级日志监控与告警系统(二,下):CI/CD 具体部署实战,一行推送实现秒级更新
ci/cd
要站在顶端1 天前
基于 curl 实现 Jenkins 上传制品到 JFrog Artifactory
运维·ci/cd·jenkins
4***99742 天前
DevOps在云原生中的CI/CD流水线
ci/cd·云原生·devops
西部森林牧歌3 天前
Arbess从基础到高阶(14) - 使用Arbess+GitLab+SonarQube实现代码扫描完成后自动化部署
ci/cd·gitlab·sonarqube·arbess·tiklab devops
青靴3 天前
虚拟机上实现最简 CI/CD
ci/cd·devops
青靴3 天前
轻量级 CI/CD:Git Hooks 自动部署 Node.js 应用(CICD-demo)
git·ci/cd·node.js
青靴4 天前
轻量级 CI/CD 实战(四):本地开发钉钉告警 → 自动部署云服务器 Kafka 消费者容器
ci/cd·docker·钉钉
奔跑吧邓邓子4 天前
Jenkins自动化持续集成:从入门到实战
ci/cd·自动化·实战·jenkins·自动化持续集成
青靴4 天前
Git Hooks 实现 CI/CD 进阶实践 -- 根据实际需求添加功能
git·elasticsearch·ci/cd
DreamLife☼4 天前
Docker-CI/CD:集成 GitHub Actions 实现自动化构建与部署
ci/cd·docker·自动化部署·github actions·镜像构建·trivy 扫描·compose 部署