使用jenkins中遇到的问题汇总/持续更新

jenkins产生大量日志文件

question: [DNSQuestion@1446063419 type: TYPE_IGNORE index 0, class: CLASS_UNKNOWN index 0, name: ]
question: [DNSQuestion@1395874330 type: TYPE_IGNORE index 0, class: CLASS_UNKNOWN index 0, name: ]
question: [DNSQuestion@1348504482 type: TYPE_IGNORE index 0, class: CLASS_UNKNOWN index 0, name: ]
question: [DNSQuestion@1919902183 type: TYPE_IGNORE index 0, class: CLASS_UNKNOWN index 0, name: ]
question: [DNSQuestion@1295053725 type: TYPE_IGNORE index 0, class: CLASS_UNKNOWN index 0, name: ]
question: [DNSQuestion@1221193730 type: TYPE_IGNORE index 0, class: CLASS_UNKNOWN index 0, name: ]
question: [DNSQuestion@1101805731 type: TYPE_IGNORE index 0, class: CLASS_UNKNOWN index 0, name: ]
question: [DNSQuestion@1759228083 type: TYPE_IGNORE index 0, class: CLASS_UNKNOWN index 0, name: ]
question: [DNSQuestion@791539085 type: TYPE_IGNORE index 0, class: CLASS_UNKNOWN index 0, name: ]
question: [DNSQuestion@1883692077 type: TYPE_IGNORE index 0, class: CLASS_UNKNOWN index 0, name: ]

正常运行几天的jenkins突然产生10+G日志,监控一直报警,内容如上
导致服务器无法访问,输入命令无法tab,既然是磁盘瞬间占满那就查询是哪个文件占满了呗
find / -type f -size +5G
会查处tomcat日志会有大文件
先删除产生的相关日志,然后停掉tomcat
最终的做法是设置日志文件级别
jenkins设置界面-系统管理-系统日志-日志级别,添加javax.jmdns - off

或者

在jenkins tomcat 的bin目录的catalina.sh 执行命令的时候添加

export JAVA_OPTS="-Dhudson.DNSMultiCast.disabled=true -Dhudson.udp=-1"

目前正在测试中/

更新,使用一个月后未出现问题

解决jenkins启动完会kill掉的衍生进程

使用jenkins创建一个任务,如果这个任务执行的服务器刚好是安装jenkins的主机
那么在jenkins中执行shell脚本或者其他命令,在整个任务创建完成后,会kill掉这个任务创建的进程
比如你启动了一个docker容器,任务执行完后容器也会退出
为了避免这种情况的发生,可以在shell中添加代码

export BUILD_ID=dontkillme

可以防止Jenkins任务启动的进程退出

构建后会历史版本残留文件

在任务配置中减少了构建历史保留的天数,但是好像没有生效

或者删除workspace和jobs中的历史构建

猜你喜欢

转载自www.cnblogs.com/mumengyun/p/10001981.html
今日推荐