Linux服务器tomact 8.0启动慢的完美解决方法

吾爱主题 阅读:154 2024-04-05 13:51:41 评论:0

环境信息:

CentOS release 6.8

tomcat-8.0

JDK1.8

一、启动tomcat

?
1 2 #sh /root/tomcat-8.0/bin/startup.sh #tailf /root/tomcat-8.0/logs/catalina.out
?
1 2 3 4 5 6 7 8 9 10 26-Aug-2017 12:58:31.661 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write /read 26-Aug-2017 12:58:31.662 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 680 ms 26-Aug-2017 12:58:31.685 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina 26-Aug-2017 12:58:31.685 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat /8 .0.32 26-Aug-2017 12:58:31.695 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /root/tomcat-8 .0 /webapps/ROOT 26-Aug-2017 12:58:36.184 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time . 26-Aug-2017 12:58:37.895 INFO [localhost-startStop-1] java.util.prefs.FileSystemPreferences$2.run Created system preferences directory in java.home. 26-Aug-2017 12:58:37.897 INFO [localhost-startStop-1] java.util.prefs.FileSystemPreferences$1.run Created user preferences directory. 26-Aug-2017 12:58:37.907 WARNING [localhost-startStop-1] java.util.prefs.FileSystemPreferences$6.run Prefs file removed in background /root/ .java/.userPrefs /prefs .xml 26-Aug-2017 12:58:37.908 WARNING [localhost-startStop-1] java.util.prefs.FileSystemPreferences$6.run Prefs file removed in background /root/jdk-1 .8 /jre/ .systemPrefs /prefs .xml

等待tomcat启动的过程是煎熬的,足足5/6分钟,在不抱希望的情况下它居然又启动完成了......

有两种解决办法:

1)在Tomcat环境中解决

在catalina.sh中加入这么一行:

-Djava.security.egd=file:/dev/./urandom

例如:

?
1 JAVA_OPTS= "-server -Xms2048m -Xmx4096m -XX:PermSize=256M -XX:MaxPermSize=512m -Djava.security.egd=file:/dev/./urandom"

2)在JVM环境中解决

修改$JAVA_PATH/jre/lib/security/java.security

?
1 securerandom. source = file : /dev/urandom

替换成

?
1 securerandom. source = file : /dev/ . /urandom

总结

以上所述是小编给大家介绍的Linux服务器tomact 8.0启动慢的完美解决方法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对服务器之家网站的支持!

原文链接:http://www.cnblogs.com/Javame/archive/2017/08/26/7435107.html

可以去百度分享获取分享代码输入这里。
声明

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

【腾讯云】云服务器产品特惠热卖中
搜索
标签列表
    关注我们

    了解等多精彩内容