Problems with CATALINA_PID and ARTIFACTORY_PID while upgrading Artifactory to the latest version

元气小坏坏 提交于 2019-12-23 12:15:28

问题


While upgrading my Artifactory server (free OSS version) from the version 5.2.0 to the latest 5.4.5, I was hit by an ARTIFACTORY_PID problem. After migrating from 5.3.2 to 5.4.0, the Artifactory server did not want to start anymore complaining about

PID file /var/opt/jfrog/run/artifactory.pid not readable (yet?) after start.

I found the only way around it is to remove the line export CATALINA_PID=$ARTIFACTORY_PID from the setenv.sh of the tomcat.

Note that upgrade from 5.2.0 to 5.3.2 went smoothly.

However, after upgrading from 5.4.0 to the latest 5.4.5 this trick does not work anymore. Now I get an error:

Job for artifactory.service failed because a configured resource limit was exceeded. See "systemctl status artifactory.service" and "journalctl -xe" for details.

And when executing service artifactory status, I get:

● artifactory.service - Setup Systemd script for Artifactory in Tomcat Servlet Engine
   Loaded: loaded (/usr/lib/systemd/system/artifactory.service; enabled; vendor preset: disabled)
   Active: activating (auto-restart) (Result: resources) since Tue 2017-07-25 09:40:10 CEST; 4s ago
  Process: 31912 ExecStart=/opt/jfrog/artifactory/bin/artifactoryManage.sh start (code=exited, status=0/SUCCESS)

Jul 25 09:40:10 linux systemd[1]: Failed to start Setup Systemd script for Artifactory in Tomcat Servlet Engine.
Jul 25 09:40:10 linux systemd[1]: Unit artifactory.service entered failed state.
Jul 25 09:40:10 linux systemd[1]: artifactory.service failed.

In fact Artifactory is now running showing version 5.4.5, but I am not happy about all those errors above.

Plus I am a bit failing to understand the purpose of CATALINA_PID and/or ARTIFACTORY_PID. Why the tomcat was failing on the startup because of this file? What was wrong with the permissions? I think I did no extra actions before.

The only difference that before it was installed from an official downloaded rpm. But now using an official remote yum repo.

If I try to create an empty /var/opt/jfrog/run/artifactory.pid file, while Artifactory is running, it gets deleted. Who is deleting this file and why? Is it a standard tomcat behavior?

OS: CentOS 7, up to date.


回答1:


Run this script:

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

It will show the exact error to you.

In my case it was java version not updated. So I updated to java 1.8.




回答2:


In my case (in a slow virtual machine) the error message from the command artifactoryManage.sh start was:

ERROR: Artifactory Tomcat server did not start in 60 seconds. Please check the logs

The log file told that the only problem was slowness (/var/opt/jfrog/artifactory/logs/artifactory.log):

### Artifactory successfully started (64.802 seconds) ###

The problem was solved by adding a longer timeout to the service definition at /etc/systemd/system/artifactory.service:

[Service]
Environment=START_TMO=120

After editing the service definition, as you know, systemctl daemon-reload was needed.



来源:https://stackoverflow.com/questions/45297704/problems-with-catalina-pid-and-artifactory-pid-while-upgrading-artifactory-to-th

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!