英文:
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...
我尝试过的事情:
- 通过检查/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:
- 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
...
通过搜索 OnOutOfMemoryError
在 https://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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论