---
title: "Centos7 搭建nexus"
author: "代码家的乐趣"
date: "2019-01-09T19:57:39Z"
tags: []
categories: ["企业架构"]
slug: "centos7-nexus"
draft: false
lastmod: "2019-01-09T20:04:28Z"
id: 2436362
url: "https://daimajia.iteye.com/blog/2436362"
---

centos7 搭建 nexus服务器

前面参考文章
<https://blog.csdn.net/smartbetter/article/details/55116889>
<https://blog.csdn.net/qq_36324685/article/details/80822174>
<https://blog.csdn.net/KingBoyWorld/article/details/79135219>




下载 nexus 到自己的工具目录  

|cd /usr/local/tools/nexus3/|


|wget http://sonatype-download.global.ssl.fastly.net/nexus/3/nexus-3.6.0-02-unix.tar.gz|

解压

|tar -zxvf nexus-3.6.0-02-unix.tar.gz|

重命名

|mv nexus-3.6.0-02  nexus|



|# vim nexus/bin/nexus.vmoptions                  //虚拟机选项配置文件|


这里就可以启动nexus了， 通过

| ./nexus start|
 启动 启动后等一会儿访问
./nexus status 查看运行状态

默认密码 admin admin123 登录可以自行修改
 ipv4:8081/nexus

如果要设置为开机启动 就需要进行后面的操作

设置jdk

|vim nexus |


|INSTALL4J_JAVA_HOME_OVERRIDE=<span style="color:red">/usr/local/tools/jdk1.8.0_141/ </span>|


连接软连接设置开机启动服务（其实就是把nexus脚本拷贝一份到启动init.d下面）
sudo ln -s /usr/local/tools/nexus3/nexus/bin/nexus  /etc/init.d/nexus 

service nexus status
service nexus start
service nexus stop

给脚本添加执行权限
chmod +x nexus

添加到开机启动
chkconfig --addnexus 

.查看开机自启的服务中是否已经有我们的nexus 
chkconfig --listnexus 

重启服务查看是否启动