在Ubuntu 16.04 Xenial(HVM)上安装工件服务的问题Amazon AWS image

时间:2018-02-05 21:36:15

标签: artifactory

我得到了这个,这对我没什么帮助。尚未创建Tomcat日志,并且war文件尚未扩展,所以我猜tomcat甚至无法启动。我该如何找出问题?

systemctl status artifactory.service                                                                 
● artifactory.service - Setup Systemd script for Artifactory in Tomcat Servlet Engine
   Loaded: loaded (/lib/systemd/system/artifactory.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Mon 2018-02-05 22:25:30 CET; 1s ago
  Process: 13760 ExecStart=/0/artifactory/bin/artifactoryManage.sh start (code=exited, status=1/FAILURE)

我按照这些installation instructions,下载并解压缩了JFrog Artifactory OSS 5.8.3,然后

unzip /0/artifactory.zip -d /0
mv /0/artifactory-oss-5.8.3 /0/artifactory
chmod +x /0/artifactory/bin/*
ARTIFACTORY_HOME=/0/artifactory bash -c '/0/artifactory/bin/installService.sh'

然后编辑/ etc / opt / jfrog / artifactory / default:

#!/bin/sh

#Default values
export ARTIFACTORY_HOME=/0/artifactory
export ARTIFACTORY_USER=artifactory
export JAVA_HOME=/a/java/jdk1.8_lin64

export TOMCAT_HOME=/0/artifactory/tomcat
export ARTIFACTORY_PID=$ARTIFACTORY_HOME/run/artifactory.pid

export JAVA_OPTIONS="-server -Xms512m -Xmx756m -Xss256k -XX:+UseG1GC -XX:OnOutOfMemoryError=\"kill -9 %p\""
export JAVA_OPTIONS="$JAVA_OPTIONS -Djruby.compile.invokedynamic=false -Dfile.encoding=UTF8 -Dartdist=zip -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true -Djava.security.egd=file:/dev/./urandom"

# Timeout waiting for artifactory to start
# START_TMO=60

最后重新安装的服务(我必须先以某种方式卸载吗?)

ARTIFACTORY_HOME=/0/artifactory bash -c '/0/artifactory/bin/installService.sh'
systemctl start artifactory.service || true
systemctl status artifactory.service

1 个答案:

答案 0 :(得分:0)

原来这是一个权限问题。

最终我解压缩到/opt/artifactory(而不是/0/artifactory),事情就开始起作用了。

我通过尝试手动启动神器来找到问题。

我查看/opt/artifactory/misc/service/artifactory.service内部并找到:

ExecStart=/opt/jfrog/artifactory/bin/artifactoryManage.sh start

artifactoryManage.sh内部,我查看了start方法并找到了:

su -s "/bin/sh" ${ARTIFACTORY_USER} -c "export JAVA_HOME='$JAVA_HOME'; $TOMCAT_HOME/bin/startup.sh"

我通过将其更改为:

来手动解决变量
su -s "/bin/sh" artifactory -c "export JAVA_HOME=/a/java/jdk1.8_lin64; /opt/artifactory/tomcat/bin/startup.sh"

然后收到权限错误。我依旧记得在安装说明中阅读了有关权限的内容:

enter image description here