八,Linxu下安装nexus私服
1,下载安装包 nexus-3.12.1-01-unix.tar.gz
2,执行解压命令,解压文件到 /usr/local/目录
tar -zxvf nexus-3.12.1-01-unix.tar.gzn -C /usr/local/
3, 进入打 /usr/local/nexus-3.12.1-01-unix/etc目录,可以查看 nexus-defaul文件,如果需要修改端口,则修改即可,不修改,默认端口为8081
4,进入 /usr/local/nexus-3.12.1-01-unix/bin 目录,执行 ./nexus 命令,若出现以下提示,则创建用户启动。
[root@VM-0-13-centos bin]# WARNING: ************************************************************
WARNING: Detected execution as "root" user. This is NOT recommended!
WARNING: ************************************************************
Usage: ./nexus {start|stop|run|run-redirect|status|restart|force-reload}
5,执行创建用户命令
useradd nexus
chown -R nexus:nexus /usr/local/nexus-3.12.1-01/
6,切换nexus 用户启动
su nexus
./nexus start
7,查看nexus 是否启动成功,出现以下,说明没有启动成功 ps aux | grep nexus
root 20174 0.0 0.1 187508 2332 pts/0 S 20:13 0:00 su nexus
nexus 20175 0.0 0.1 116040 2940 pts/0 S 20:13 0:00 bash
nexus 22323 0.0 0.0 139496 1644 pts/0 R+ 20:22 0:00 ps aux
nexus 22324 0.0 0.0 112644 964 pts/0 R+ 20:22 0:00 grep --color=auto nexus
8,执行命令,查看没有启动成功原因
./nexus run ,出现sonatype-work,说明没有给此用户授予该文件权限
执行以下命令,授权
chown -R nexus:nexus /usr/local/sonatype-work/
9,重新 执行 ./nexus start 查看是否启动成功
10, 登录地址,默认使用8081端口,使用默认账户密码 admin/admin123登录系统
11, 登录后,如果提示 4096,则在linxu 服务器上,查看 open file 的大小
执行命令 ulimt -a 查看 open file 大小
12, 执行命令 vim /etc/security/limits.conf 修改大小
在文件最后,新增以下两句命令
soft nofile 65536
hard nofile 65536
13, 设置开机启动
vi /etc/rc.d/rc.local
在文件中 增加以下命令 su - nexus -c '/usr/local/nexus-3.12.1-01/bin/nexus start'
14, reboot 重启系统

浙公网安备 33010602011771号