Tomcat上的战争部署需要很长时间 [英] War deployment on Tomcat takes ages
问题描述
我有一个Grails应用程序,内置于war文件(~30mb)。当我尝试通过应用程序管理器在Tomcat 6上部署war文件时,部署或无限期挂起需要10分钟。当它挂起时我可以重新启动Tomcat并且通常会部署应用程序,但有时我必须重复此过程。我还注意到在部署期间,Java进程最大化了CPU并且RAM大约为10-15%。
I have a Grails application, built to a war file (~30mb). When I attempt to deploy the war file on Tomcat 6 via the application manager, it takes upwards of 10 minutes to deploy, or hangs indefinitely. When it hangs I can restart Tomcat and the app is usually deployed, however sometimes I have to repeat the process. I've also noticed that during deployment, the Java process maxes out the CPU and the RAM is at ~10-15%.
我对Java很新,所以我不知道这是否正常,但我无法想象它是怎么回事。有什么我可以做的让这个运行更顺畅/更快?有没有比Tomcat的应用程序管理器更好的部署方式?
I'm fairly new to Java, so I don't know if this is normal, but I can't imagine how it could be. Is there something I can do to make this run smoother/faster? Is there a better way to deploy than Tomcat's app manager?
推荐答案
我将WAR上传到我的主目录,cd到/ usr / local / tomcat,然后运行以下命令:
I upload the WAR to my home directory, cd to /usr/local/tomcat, then run the following commands:
bin/shutdown.sh
rm webapps/ROOT.war
rm -rf webapps/ROOT
cp ~/ROOT.war webapps
bin/startup.sh
这篇关于Tomcat上的战争部署需要很长时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!