問題
如果 WAR 檔很大,部署的時候,解壓縮 WAR 如果需要 30 秒,這段時間應用程式就會停止服務。
解法
減少部署過程中 ,應用程式無法服務的時間。
undeployOldVersions
https://tomcat.apache.org/tomcat-8.0-doc/config/host.html
war naming
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Naming
綜合以上兩種設定,我們可以在已經部署
myapp.war
的情況下,再部署新版
myapp##2.war
待新版部署完畢,Tomcat 就會自動移掉舊版。
留言