本文用的docker方式部署

docker pull sonatype/nexus3:3.16.0
mkdir /opt/nexus-data
chown -R  200 /opt/nexus-data
docker run -d --name nexus --ulimit nofile=65536:65536 -p 8081:8081 -v /opt/nexus-data:/nexus-data sonatype/nexus3:3.16.0
cat /opt/nexus-data/admin.password 

yum仓库如下配置

#yum-nexus
vi /etc/yum.repos.d/CentOS-Nexus.repo
[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://192.168.1.192:8081/repository/centos/$releasever/os/$basearch/
enabled=1
gpgcheck=0
gpgkey=http://192.168.1.192:8081/repository/centos/RPM-GPG-KEY-CentOS-7
 
#released updates 
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://192.168.1.192:8081/repository/centos/$releasever/updates/$basearch/
enabled=1
gpgcheck=0
gpgkey=http://192.168.1.192:8081/repository/centos/RPM-GPG-KEY-CentOS-7
 
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://192.168.1.192:8081/repository/centos/$releasever/extras/$basearch/
enabled=1
gpgcheck=0
gpgkey=http://192.168.1.192:8081/repository/centos/RPM-GPG-KEY-CentOS-7
 
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://192.168.1.192:8081/repository/centos/$releasever/centosplus/$basearch/
enabled=1
gpgcheck=0
gpgkey=http://192.168.1.192:8081/repository/centos/RPM-GPG-KEY-CentOS-7
 
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
baseurl=http://192.168.1.192:8081/repository/centos/$releasever/contrib/$basearch/
enabled=0
gpgcheck=0
gpgkey=http://192.168.1.192:8081/repository/centos/RPM-GPG-KEY-CentOS-7


vi /etc/yum.repos.d/epel-nexus.repo
[nexus_epel]
name=Nexus Epel Repository
baseurl=http://192.168.1.192:8081/repository/epel/$releasever/$basearch/
        http://mirrors.aliyun.com/epel/7/$basearch
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7