Fork me on GitHub

Nexus之Nexus3尝鲜

Nexus3尝鲜

Nexus简介

官网地址
官网帮助文档

Nexus2和Nexus3支持formats差别


安装JDK

openjdk比较精简,会出现各种奇葩问题,故使用Oracle JDK版本
下载地址 下载jdk-8u151-linux-x64.rpm

1
2
3
4
5
6
7
8
9
10
11
# rpm -ivh jdk-8u151-linux-x64.rpm
# vim /etc/profile
# JAVA bin PATH setup
export JAVA_HOME=/usr/java/jdk1.8.0_151/
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
# source /etc/profile
# java -version
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)

安装Maven

下载地址下载apache-maven-3.5.2-bin.tar.gz

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.5.2/binaries/apache-maven-3.5.2-bin.tar.gz
# tar -zxf apache-maven-3.5.2-bin.tar.gz
# mv apache-maven-3.5.2
# mv apache-maven-3.5.2 /usr/local/
# ln -s apache-maven-3.5.2/ maven
# vim /etc/profile
export M2_HOME=/usr/local/maven
export PATH=$PATH:$M2_HOME/bin
# source /etc/profile
# mvn -version
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T03:58:13-04:00)
Maven home: /usr/local/maven
Java version: 1.8.0_151, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-5.b12.el7_4.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-327.el7.x86_64", arch: "amd64", family: "unix"

安装Nexus

下载地址 下载版本nexus-3.8.0-02-unix.tar.gz

1
2
3
4
5
6
7
8
9
10
11
12
13
# wget https://sonatype-download.global.ssl.fastly.net/nexus/3/nexus-3.8.0-02-unix.tar.gz
# tar -zxf nexus-3.8.0-02-unix.tar.gz
# cp -r nexus-3.8.0-02 /usr/local/
# cd /usr/local/
# ln -s nexus-3.8.0-02/ nexus
# cd /usr/local/nexus/bin/
# ./nexus start
WARNING: ************************************************************
WARNING: Detected execution as "root" user. This is NOT recommended!
WARNING: ************************************************************
Starting nexus
# netstat -tunlp|grep 8081
tcp 0 0 0.0.0.0:8081 0.0.0.0:* LISTEN 21544/java

Run as a Service

将nexus设置为Linux系统的服务,并开机自动启动,请点击

Run Behind a Reverse Proxy

点击

配置完成后,您可以访问web界面 http://{IP}:8081/nexus/ ,进入系统进行设置
默认管理账号:admin 密码:admin123

修复文件描述符问题

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
[root@linux-node9 nexus]# vim /etc/security/limits.conf
@root - nofile 65536
[root@linux-node9 ~]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 15062
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 65536
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 15062
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[root@linux-node9 ~]# /usr/local/nexus/bin/nexus restart
WARNING: ************************************************************
WARNING: Detected execution as "root" user. This is NOT recommended!
WARNING: ************************************************************
Shutting down nexus
Stopped.
Restarting nexus

Nexus管理

Proxying Maven and NPM

参考资料:https://help.sonatype.com/display/NXRM3/Quick+Start+Guide+-+Proxying+Maven+and+NPM

1
# npm init    # 初始化一个package.json文件

High Availability - Introduction

参考资料:https://help.sonatype.com/display/NXRM3/High+Availability+-+Introduction

Backup and Restore

参考资料:https://help.sonatype.com/display/NXRM3/Configure+and+Run+the+Backup+Task

Maven Repositories

参考资料:https://help.sonatype.com/display/NXRM3/Maven+Repositories

Private Registry for Docker

参考资料:https://help.sonatype.com/display/NXRM3/Private+Registry+for+Docker

Security

Realms

Privileges

Roles

Users

Anonymous Access

LDAP

Security Setup with User Tokens

Authentication via Remote User Token

Configuring SSL

  • Outbound SSL - Trusting SSL Certificates of Remote Repositories
  • Outbound SSL - Trusting SSL Certificates Globally
  • Outbound SSL - Trusting SSL Certificates Using Keytool
  • Inbound SSL - Configuring to Serve Content via HTTPS
    • Using A Reverse Proxy Server
    • Serving SSL Directly
    • How to Enable the HTTPS Connector
    • How to Redirect All Plain HTTP Requests to HTTPS
    • How to Disable the HTTP Connector

      重点:掌握Inbound SSL配置方法

Auditing

参考资料

https://www.sonatype.com/

======================================================
希望各位朋友支持一下

本文作者:dongsheng
本文地址https://mds1455975151.github.io/archives/5f9114b.html
版权声明:转载请注明出处!

坚持技术分享,您的支持将鼓励我继续创作!