微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

由于 OOM-Kill,Jenkins 无法在 redhat linux 中启动

如何解决由于 OOM-Kill,Jenkins 无法在 redhat linux 中启动

我启动了一个 aws ec2 实例,它正在运行 jenkins。它运行良好,但几天后自动停止运行。 我使用 dmesg 诊断了问题,但出现以下错误

 oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/system.slice/jenkins.service,task=java,pid=1168,uid=993
[233949.461595] Out of memory: Killed process 1168 (java) total-vm:2251668kB,anon-RSS:317444kB,file-RSS:0kB,shmem-RSS:0kB,UID:993
[233949.566855] oom_reaper: reaped process 1168 (java),Now anon-RSS:0kB,shmem-RSS:0kB
[ec2-user@ip-172-31-18-74 ~]$ ^C
[ec2-user@ip-172-31-18-74 ~]$ ps -f 1168
UID          PID    PPID  C STIME TTY      STAT   TIME CMD

我在网上找到的解决方案是编辑 /var/lib/jenkins 中的 jenkins.xml。但我找不到 jenkins.xml 而我有 config.xml

?xml version='2.1' encoding='UTF-8'?>
<hudson>
  <disabledAdministrativeMonitors>
    <string>jenkins.diagnostics.RootUrlNotSetMonitor</string>
  </disabledAdministrativeMonitors>
  <version>2.263.4</version>
  <installStateName>RUNNING</installStateName>
  <numExecutors>2</numExecutors>
  <mode>norMAL</mode>
  <useSecurity>true</useSecurity>
  <authorizationStrategy class="hudson.security.FullControlOnceLoggedInAuthorizationStrategy">
    <denyAnonymousReadAccess>true</denyAnonymousReadAccess>
  </authorizationStrategy>
  <securityRealm class="hudson.security.HudsonPrivateSecurityRealm">
    <disableSignup>true</disableSignup>
    <enableCaptcha>false</enableCaptcha>
  </securityRealm>
  <disableRememberMe>false</disableRememberMe>
  <projectNamingStrategy class="jenkins.model.ProjectNamingStrategy$DefaultProjectNamingStrategy"/>
  <workspaceDir>${JENKINS_HOME}/workspace/${ITEM_FULL_NAME}</workspaceDir>
  <buildsDir>${ITEM_ROOTDIR}/builds</buildsDir>
  <jdks>
    <jdk>
      <name>Java</name>
      <home>/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-2.el8_3.x86_64</home>
      <properties/>
    </jdk>
  </jdks>
  <viewsTabBar class="hudson.views.defaultviewsTabBar"/>
  <myViewsTabBar class="hudson.views.DefaultMyViewsTabBar"/>
  <clouds/>
  <scmCheckoutRetryCount>0</scmCheckoutRetryCount>
  <views>
    <hudson.model.AllView>
      <owner class="hudson" reference="../../.."/>
      <name>all</name>
      <filterExecutors>false</filterExecutors>
      <filterQueue>false</filterQueue>
      <properties class="hudson.model.View$PropertyList"/>
    </hudson.model.AllView>
  </views>
  <primaryView>all</primaryView>

我不知道如何通过任何其他解决方案减少堆大小或解决问题。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。