Centos7环境下nexus的安装

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Caiaixiong/article/details/89203656

安装步骤

#1.下载地址
https://www.sonatype.com/download-oss-sonatype
#2.解压
tar -zxvf nexus-3.15.2-01-unix.tar.gz -C /usr/local/
#3.默认端口8081(不进行修改),若需要修改默认使用端口
vim /usr/local/nexus-3.15.2-01/etc/nexus-default.properties
#4.开放8081端口
firewall-cmd --permanent --add-port=8081/tcp
#5.启动nexus
/usr/local/nexus-3.15.2-01/bin/nexus start &
此时会出现,警告: Detected execution as "root" user.  This is NOT recommended!
因此我们需要创建新用户去启动
#6.添加用户
useradd nexus
#7.为新用户修改密码
passwd nexus
#8.修改从压缩包解压出来的两个文件夹的所属用户和用户组
chown -R nexus:nexus /usr/local/nexus-3.15.2-01/
chown -R nexus:nexus /usr/local/sonatype-work/
#9.重新尝试启动,需要等待一段时间
/usr/local/nexus-3.15.2-01/bin/nexus start &
#10.访问并登录
http://192.168.48.128:8081
默认账号:admin 密码:admin123
#11.首页上可能会出现警告:System Requirement: max file descriptors [4096] likely too low, increase to at least [65536]
解决:vim /etc/security/limits.conf
添加内容:	* soft nofile 65536
			* hard nofile 65536
#12.将nexus可执行程序添加进环境变量
vim /etc/profile
添加内容:
			NEXUS_HOME=/usr/local/nexus-3.15.2-01/bin
			export NEXUS_HOME
			PATH=$PATH:$NEXUS_HOME
			export PATH
#13.生效:source /etc/profile
#14.设置nexus开机自启动
vim /etc/rc.d/rc.local
添加内容
				su - nexus -c 'nexus start &'
#15.给rc.local文件添加可执行权限
chmod +x /etc/rc.d/rc.local
#16.重启
reboot
#17.查看是否已经自启动
ps aux | grep nexus			

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/Caiaixiong/article/details/89203656