there was insufficient free space available after evicting expired cache entries
问题描述:
自己购买的阿里云服务器上部署的Jenkins无法访问。
问题分析:
1.查看jenkins对应的tomcat服务是否开启
ps -aux|grep tomcat-jenkins
输出结果如下:
2. 使用curl在云服务器终端本机访问jenkins
curl http://127.0.0.1:7070/jenkins
输出结果如下:
从上图可以看出,使用curl命令访问返回的html信息,跳转到登录页面对应的代码,需要进一步的用户身份认证Authentication required
3.查看tomcat-jenkins的catalina.out的日志信息
tail -f -n 100 ./catalina.out
输出结果如下:
日志信息中反复提到的问题是: org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/WEB-INF/classes/jenkins/install/SetupWizard/index.groovy] to the cache for web application [/jenkins] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
不能放置相关资源到cache中,考虑增加cache的大小
问题解决:
1.修改tomcat-jenkins的conf/context.xml ,调大缓存
jenkins系统要加载不少图片,而tomcat8以上对resource采取了cache,而默认的大小是10M. 如果超过了此限制,影响jenkins系统的正常访问。
在</Context>之前添加如下代码
<Resources cachingAllowed="true" cacheMaxSize="102400" />
静态资源缓存最大值,以KB为单位,默认值为10240KB,本文中将其扩大10倍,即102400KB
修改完成后的context.xml如下
2.重启tomcat-jenkins,查看输出的日志信息
tail -f -n 50 ./catalina.out
tomcat启动成功
3.在浏览器中访问jenkins服务,可以跳转到登录页面