centos7 安装nexus

零 修订记录

序号 修订内容 修订时间
1 新增 2021/2/22

一 摘要

本文介绍centos7 安装nexus

二 环境信息

(一)操作系统及jdk

操作系统:Centos 7.3.1611
jdk:jdk1.8
安装用户:非root 用户
安装目录:/home/yunwei/middleware/nexus

    LSB Version:    :core-4.1-amd64:core-4.1-noarch
    Distributor ID: CentOS
    Description:    CentOS Linux release 7.3.1611 (Core) 
    Release:        7.3.1611
    Codename:       Core
    [yunwei@webmysql1 ~]$ uname -a
    Linux webmysql1 3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
    [yunwei@webmysql1 ~]$ java -version
    java version "1.8.0_231"
    Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
    Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)
    [yunwei@webmysql1 ~]$

(二)nexus 信息

nexus-3.21.1-01-unix.tar.gz
https://help.sonatype.com/repomanager3/download

三 实施

(一)安装

3.1.1 解压安装

新建目录nexus ,然后到该目录下 解压包,解压后有两个文件夹

nexus-3.21.1-01:nexus 运行所需要的的文件
sonatype-work: nexus 生成的配置文件、日志文件、仓库文件等。当我们需要备份 Nexus 的时候默认备份此目录即可

    [yunwei@webmysql1 nexus]$ tar -zxf /home/yunwei/software/nexus-3.21.1-01-unix.tar.gz 
    [yunwei@webmysql1 nexus]$ ll
    total 8
    drwxrwxr-x 9 yunwei yunwei 4096 Mar  7 15:33 nexus-3.21.1-01
    drwxrwxr-x 3 yunwei yunwei 4096 Mar  7 15:33 sonatype-work
    [yunwei@webmysql1 nexus]$ pwd
    /home/yunwei/middleware/nexus
    [yunwei@webmysql1 nexus]$

3.1.2 修改配置(可选)

修改任何文件前都是老规矩,先备份。

修改启动用户:
/home/yunwei/middleware/nexus/nexus-3.21.1-01/bin/nexus.rc

    #run_as_user=""

修改启动端口:
/home/yunwei/middleware/nexus/nexus-3.21.1-01/etc/nexus-default.properties

    application-port=8081

3.1.3 配置环境变量

    [yunwei@webmysql1 ~]$ cp .bash_profile .bash_profile.bak`date +"%Y%M$D%H%M%S"`
    修改 .bahs_profile 添加 

    NEXUS_HOME=/home/yunwei/middleware/nexus/nexus-3.21.1-01
    export NEXUS_HOME
    PATH=$PATH:$NEXUS_HOME/bin

    退出vi

    [yunwei@webmysql1 ~]$ source .bash_profile
    [yunwei@webmysql1 ~]$

3.1.4 启动及验证

[yunwei@webmysql1 ~]$ nexus start
Starting nexus

在该文件获取密码
/home/yunwei/middleware/nexus/sonatype-work/nexus3/admin.password

然后下一步,然后重置密码 admin admin

posted on 2021-02-22 09:37  weiwei2021  阅读(379)  评论(0编辑  收藏  举报