[英]How to install sonatype nexus in Linux through YAML Scripting?
[英]Install Sonatype Nexus 2 as a service
我想知道如何在GNU / Linux上将Sonatype Nexus 2安装为服务,以便对其进行正确配置并在启动时自动启动。
创建具有足够访问权限的关系用户来运行服务
useradd nexus
将$ NEXUS_HOME / bin / nexus复制到/etc/init.d/nexus,使/etc/init.d/nexus脚本可执行并由root用户拥有:
chmod 755 /etc/init.d/nexus
chown root /etc/init.d/nexus
编辑此脚本,更改以下变量:
-将存储库管理器使用的目录的所有者和组(包括在nexus.properties中配置为默认为sonatype-work / nexus的nexus-work)更改为将运行该应用程序的nexus用户。
chown nexus:nexus NEXUS_HOME -R
-如果Java不在运行资源库管理器的用户的默认路径上,请添加一个JAVA_HOME变量,该变量指向您的本地Java安装,然后将$ JAVA_HOME / bin添加到PATH。
在Red Hat,Fedora和CentOS上作为服务运行
该脚本具有适当的chkconfig指令,因此您需要做的就是添加存储库管理器,因为服务运行以下命令:
cd /etc/init.d
chkconfig --add nexus
chkconfig --levels 345 nexus on
service nexus start
Starting Nexus Repository Manager Pro...
tail -f NEXUS_HOME/logs/wrapper.log
第二个命令将nexus添加为要使用service命令启动和停止的服务。 chkconfig管理/etc/rc[0-6].d中的符号链接,这些符号链接控制在操作系统重新启动或在运行级别之间转换时启动和停止服务。 第三个命令在运行级别3、4和5上添加关系。service命令启动存储库管理器,最后一个命令在wrapper.log尾部验证其是否已成功启动。 如果存储库管理器已成功启动,则应该看到一条消息,通知您它正在侦听HTTP。
作为服务在Ubuntu和Debian上运行
在Ubuntu上将存储库管理器设置为服务的过程与Red Hat变体上使用的过程略有不同。 在/etc/init.d中配置启动脚本后,应该运行以下命令序列,而不是运行chkconfig。
cd /etc/init.d
update-rc.d nexus defaults
service nexus start
Starting Nexus Repository Manager Pro...
tail -f NEXUS_HOME/logs/wrapper.log
有关Nexus 2的文档,请访问
https://books.sonatype.com/nexus-book/reference/install-sect-service.html
对于Nexus 3,它位于
https://books.sonatype.com/nexus-book/reference3/install.html#service-linux
建议不同。 一个示例是使用sym链接代替复制nexus
启动脚本
sudo ln -s $NEXUS_HOME/bin/nexus /etc/init.d/nexus
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.