artifactory.service: 失败,结果为 ‘退出码’

huangapple go评论84阅读模式
英文:

artifactory.service: Failed with result 'exit-code'

问题

环境描述:

artifactory版本:jfrog-artifactory-oss-7.55.2-linux
java版本:openjdk版本 "17.0.5" 2022-10-18
系统版本:
名称="Ubuntu"
版本="18.04.3 LTS(Bionic Beaver)"

问题描述:

artifactory.service每隔几个小时重新启动,有时artifactory.service将无法正常运行。
journalctl -u artifactory.service显示以下日志

2月 22 15:17:25 Artifactory systemd[1]: artifactory.service: Main process exited, code=exited, status=143/n/a
2月 22 15:17:25 Artifactory systemd[1]: artifactory.service: Failed with result 'exit-code'.
2月 22 15:17:25 Artifactory systemd[1]: Stopped Artifactory service.
2月 22 15:18:14 Artifactory systemd[1]: Starting Artifactory service...

我尝试过的事情:

  1. 通过检查/opt/jfrog/artifactory/var/log/console.log的控制台日志,我没有找到任何有用的信息。
英文:

Environment description:

artifactory version: jfrog-artifactory-oss-7.55.2-linux
java version: openjdk version "17.0.5" 2022-10-18
system version:
NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"

problem description

artifactory.service restarted every several hours and sometimes artifactory.service will not be functionable.
journalctl -u artifactory.service shows below log

2月 22 15:17:25 Artifactory systemd[1]: artifactory.service: Main process exited, code=exited, status=143/n/a
2月 22 15:17:25 Artifactory systemd[1]: artifactory.service: Failed with result 'exit-code'.
2月 22 15:17:25 Artifactory systemd[1]: Stopped Artifactory service.
2月 22 15:18:14 Artifactory systemd[1]: Starting Artifactory service...

Things I tried:

  1. By checking the console log of /opt/jfrog/artifactory/var/log/console.log, i haven't found anything useful.

答案1

得分: 1

分析

进一步检查由:

# ps -ef --forest | less | grep artifactory
...
-server -XX:+UseG1GC -XX:OnOutOfMemoryError=kill -9 %p -Xms512m -Xmx2g
...

通过搜索 OnOutOfMemoryErrorhttps://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/clopts001.html 得到 此选项可用于指定在抛出OutOfMemoryError异常时执行的命令或脚本。
并通过执行以下命令找到

# grep 'OutOfMemoryError' -rn /opt/jfrog/artifactory/var/log
Binary file /opt/jfrog/artifactory/var/log/artifactory-service.log matches
Binary file /opt/jfrog/artifactory/var/log/archived/artifactory-service.2023-06-08T12-25-37.903.log matches
Binary file /opt/jfrog/artifactory/var/log/archived/console-2023-06-08-1686189301.log matches
Binary file /opt/jfrog/artifactory/var/log/console.log matches

通过检查日志发现以下信息:

[65027.377s][warning][gc,alloc] http-nio-127.0.0.1-8091-Acceptor: Retried waiting for GCLocker too often allocating 1026 words
#
# java.lang.OutOfMemoryError: Java heap space
# -XX:OnOutOfMemoryError="kill -9 %p"
#   Executing /bin/sh -c "kill -9 10131"...

解决方案:

参考 https://jfrog.com/help/r/jfrog-installation-setup-documentation/artifactory-system-yaml
我更改了

  #extraJavaOpts: "-Xms512m -Xmx2g"

  extraJavaOpts: "-Xms50g -Xmx100g"

然后

systemctl restart artifactory.service
英文:

Analysis

Further checking by:

# ps -ef --forest | less | grep artifactory
...
-server -XX:+UseG1GC -XX:OnOutOfMemoryError=kill -9 %p -Xms512m -Xmx2g
...

By search OnOutOfMemoryError got This option can be used to specify a command or script to execute when an OutOfMemoryError exception is thrown. in https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/clopts001.html
And by executing below found

# grep 'OutOfMemoryError' -rn /opt/jfrog/artifactory/var/log
Binary file /opt/jfrog/artifactory/var/log/artifactory-service.log matches
Binary file /opt/jfrog/artifactory/var/log/archived/artifactory-service.2023-06-08T12-25-37.903.log matches
Binary file /opt/jfrog/artifactory/var/log/archived/console-2023-06-08-1686189301.log matches
Binary file /opt/jfrog/artifactory/var/log/console.log matches

And by checking the log found below:

[65027.377s][warning][gc,alloc] http-nio-127.0.0.1-8091-Acceptor: Retried waiting for GCLocker too often allocating 1026 words
#
# java.lang.OutOfMemoryError: Java heap space
# -XX:OnOutOfMemoryError="kill -9 %p"
#   Executing /bin/sh -c "kill -9 10131"...

Solution:

refer to https://jfrog.com/help/r/jfrog-installation-setup-documentation/artifactory-system-yaml
I changed

  #extraJavaOpts: "-Xms512m -Xmx2g"

to

  extraJavaOpts: "-Xms50g -Xmx100g"

then

systemctl restart artifactory.service

huangapple
  • 本文由 发表于 2023年6月9日 09:15:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/76436599.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定