大叔经验分享(88)jenkins假死
jenkins安装启动后,使用systemctl来进行进程监控
# systemctl enable jenkins
但是还是经常发生jenkins进程挂了,不会自动重启,通过systemctl查看状态为:
# systemctl status jenkins
● jenkins.service - LSB: Jenkins Automation Server
Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)
Active: active (exited) since Tue 2019-09-24 18:52:26 CST; 1 months 1 days ago
Docs: man:systemd-sysv-generator(8)
Tasks: 0
Memory: 0B
查看日志没有任何异常,可能的原因如下:
Possibly the Linux kernel's oom-killer ("out-of memory killer") killed your JVM. It sends a SIGKILL signal to selected processes if the physical memory is no longer sufficient to accomodate all processes. Check that output of journalctl
for lines containing the string oom-killer
to confirm.
It is normal that the oom-killer strikes only after a certain period. Normally, Linux does not impose restrictions on the amount of virtual memory that a process requests (so your JVM can easily allocate 2 GiB of RAM on a 512 MiB system). However, if the process starts actually using the allocated memory (in your case: amount of used heap grows), then the kernel may find that the amount of physical memory is no longer sufficient. This is the point where the oom-killer will select a promising candiate process to be killed. Jenkins, as a non-system process that consumes a lot of memory, has very good chances to be the one that will be killed.
You can solve the situation by
- adding more physical memory to your system
- reducing JVM memory settings (e.g., smaller heap)
修改jenkins占用内存
# vi /etc/sysconfig/jenkins
JENKINS_JAVA_OPTIONS="-Xmx512m"
参考:https://stackoverflow.com/questions/42607771/jenkins-active-exited
相关文章
- 【taro react】---- H5 通过 Jenkins 实现自动化部署
- Jenkins的详细安装及使用
- 基于Kubernetes集群的Jenkins CI/CD版本上线流程部署
- 技术分享 | Jenkins job 机制该如何使用?
- Jenkins(3)拉取git仓库代码,执行python自动化脚本[通俗易懂]
- Jenkins安装_安装
- [第11期] Jenkins-使用共享库对Pipeline扩展
- Jenkins Pipeline as code实践
- DevOps整合Jenkins+k8s+CICD
- Jenkins pipeline Git 检出的 Step
- jenkins持续集成环境从0到1搭建全过程
- Jenkins 初体验
- 软件测试|一键搞定centos7的docker+selenium+appium+jenkins+android_app源码打包成apk的环境搭建
- Jenkins 自由风格项目Freestyle project和流水线pipeline解释
- jenkins项目上线(测试上线)教程