6 月 112019
安装JDK
[root@iZj6cehstgjoj3qav88fidZ ~]# yum -y install jdk-8u211-linux-x64.rpm
查看JDK版本信息
[root@iZj6cehstgjoj3qav88fidZ ~]# java -version java version "1.8.0_211" Java(TM) SE Runtime Environment (build 1.8.0_211-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode) [root@iZj6cehstgjoj3qav88fidZ ~]#
下载Nexus二进制包
[root@iZj6cehstgjoj3qav88fidZ ~]# wget https://download.sonatype.com/nexus/oss/nexus-latest-bundle.tar.gz --2019-06-25 18:44:20-- https://download.sonatype.com/nexus/oss/nexus-latest-bundle.tar.gz Resolving download.sonatype.com (download.sonatype.com)... 34.206.81.156, 35.168.192.73 Connecting to download.sonatype.com (download.sonatype.com)|34.206.81.156|:443... connected. HTTP request sent, awaiting response... 302 Moved Temporarily Location: https://sonatype-download.global.ssl.fastly.net/repository/repositoryManager/oss/nexus-2.14.13-01-bundle.tar.gz [following] --2019-06-25 18:44:21-- https://sonatype-download.global.ssl.fastly.net/repository/repositoryManager/oss/nexus-2.14.13-01-bundle.tar.gz Resolving sonatype-download.global.ssl.fastly.net (sonatype-download.global.ssl.fastly.net)... 151.101.77.194 Connecting to sonatype-download.global.ssl.fastly.net (sonatype-download.global.ssl.fastly.net)|151.101.77.194|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 82396385 (79M) [application/x-gzip] Saving to: ‘nexus-latest-bundle.tar.gz’ 100%[=======================================================================================================================================================>] 82,396,385 12.2MB/s in 5.4s 2019-06-25 18:44:27 (14.5 MB/s) - ‘nexus-latest-bundle.tar.gz’ saved [82396385/82396385] [root@iZj6cehstgjoj3qav88fidZ ~]#
解压缩文件
[root@iZj6cehstgjoj3qav88fidZ ~]# mkdir -p /usr/local/nexus [root@iZj6cehstgjoj3qav88fidZ ~]# tar xzf nexus-latest-bundle.tar.gz -C /usr/local/nexus/ [root@iZj6cehstgjoj3qav88fidZ ~]# ls /usr/local/nexus/ nexus-2.14.13-01 sonatype-work [root@iZj6cehstgjoj3qav88fidZ ~]#
添加用户并修改目录所有权限
[root@iZj6cehstgjoj3qav88fidZ ~]# useradd nexus [root@iZj6cehstgjoj3qav88fidZ ~]# chown -R nexus.nexus /usr/local/nexus/ [root@iZj6cehstgjoj3qav88fidZ ~]#
切换用户并进入Nexus可执行程序目录
[root@iZj6cehstgjoj3qav88fidZ ~]# su - nexus Last login: Tue Jun 25 18:36:38 CST 2019 on pts/1 [nexus@iZj6cehstgjoj3qav88fidZ ~]$ cd /usr/local/nexus/nexus-2.14.13-01/bin/ [nexus@iZj6cehstgjoj3qav88fidZ bin]$ ./nexus --help Usage: ./nexus { console | start | stop | restart | status | dump } [nexus@iZj6cehstgjoj3qav88fidZ bin]$
启动服务并查看服务运行状态
[nexus@iZj6cehstgjoj3qav88fidZ bin]$ ./nexus start Starting Nexus OSS... Started Nexus OSS. [nexus@iZj6cehstgjoj3qav88fidZ bin]$ [nexus@iZj6cehstgjoj3qav88fidZ bin]$ ./nexus status Nexus OSS is running (14829). [nexus@iZj6cehstgjoj3qav88fidZ bin]$
查看监听
使用浏览器访问Nexus控制台服务