部署 Nexus私有仓库

官方要求内存8G以上,太小比如4G以下会导致无法启动

https://help.sonatype.com/repomanager3/installation/system-requirements

在这里插入图片描述

安装jdk

[root@ubuntu2004-160 ~]#apt -y install openjdk-8-jdk
[root@ubuntu2004-160 ~]#java -version

下载Nexus
官方下载网址

https://help.sonatype.com/repomanager3/product-information/download

在这里插入图片描述
在这里插入图片描述

解压到/usr/local/
[root@ubuntu2004-160 ~]#ls /usr/local/
bin  etc  games  include  lib  man  nexus-3.41.1-01  sbin  share  sonatype-work  src

查看解压目录中的文件
[root@ubuntu2004-160 ~]#ls /usr/local/nexus/
bin  deploy  etc  lib  NOTICE.txt  OSS-LICENSE.txt  PRO-LICENSE.txt  public  replicator  system

创建软链接
[root@ubuntu2004-160 ~]#ln -s /usr/local/nexus-3.41.1-01/ /usr/local/nexus
创建环境变量链接
[root@ubuntu2004-160 ~]#ln -s /usr/local/nexus/bin/nexus /usr/bin/

切换到nexus目录
[root@ubuntu2004-160 nexus]#cd /usr/local/nexus
指定运行身份
[root@ubuntu2004-160 nexus]#cat bin/nexus.rc
run_as_user="root"

查看配置文件,可以在此文件中修改端口等配置

[root@ubuntu2004-160 nexus]#vim etc/nexus-default.properties 

在这里插入图片描述
查看JVM配置文件

[root@ubuntu2004-160 nexus]#vim bin/nexus.vmoptions 

在这里插入图片描述

创建service文件

[root@ubuntu2004-160 ~]#vim /lib/systemd/system/nexus.service
[Unit]
Description=nexus service
After=network.target

[Service]
Type=forking
LimitNOFILE=65536
ExecStart=/usr/local/nexus/bin/nexus start
ExecStop=/usr/local/nexus/bin/nexus stop
#User=nexus
User=root
Restart=on-abort

[Install]
WantedBy=multi-user.target

在这里插入图片描述

加载service文件
[root@ubuntu2004-160 ~]#systemctl daemon-reload
启动
[root@ubuntu2004-160 ~]#systemctl enable --now nexus.service

查看端口
在这里插入图片描述

通过浏览器访问

http://10.0.0.160:8081/

在这里插入图片描述

查看登录admin密码

[root@ubuntu2004-160 ~]#cat /usr/local/sonatype-work/nexus3/admin.password 
cdef3ff5-69ac-4d2f-a8bd-9986919629e6

登录后修改密码
在这里插入图片描述
启用匿名访问将默认允许未经授权的下载,浏览和搜索存储库内容,可以通过编辑分配给匿名用户的角色来更改匿名用户的权限。生产建议打开匿名访问功能,无需登录就可以下载资源
在这里插入图片描述
设置maven仓库,yum仓库,apt仓库
在这里插入图片描述
邮件配置
在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值