一、問題(1)
1、centos7 安裝jenkins ,tomcat9, jenkisn.war
2、啓動tomcat後,輸入密碼後一直卡在一個頁面那裏
3、排查原因:看日誌發現了一段:
04-Mar-2020 21:31:33.020 WARNING [Handling GET /jenkins/login from 192.168.1xx.xx : http-nio-8080-exec-2 Jenkins/login.jelly] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/WEB-INF/side-files/hudson/model/Descriptor/index.html] 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
然後定位到了tomcat的配置文件context.xml,路徑一般在:apache-tomcat-xxx\conf\context.xml,默認只有10M的大小.,cacheMaxSize的單位是kb。
4、解決:在Context中添加<Resources cachingAllowed="true" cacheMaxSize="150000" ></Resources>
二、問題(2)
war包tomcat運行的qing情況下,如果問題(1)已經處理,還是在空白頁,則進行一下操作,瀏覽器另外開一個tab窗口,訪問:
http://192.168.1xx.1xx:8080/jenkins/pluginManager/advanced,找到Update Site,然後修改url爲:https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json,提交。
最後重啓tomcat。
參考:【1】https://www.jianshu.com/p/1e411d225186