温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Linux服务器tomact 8.0启动慢怎么办

发布时间:2021-06-21 15:27:43 来源:亿速云 阅读:143 作者:小新 栏目:服务器

小编给大家分享一下Linux服务器tomact 8.0启动慢怎么办,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!

环境信息:

CentOS release 6.8

tomcat-8.0

JDK1.8

一、启动tomcat

#sh /root/tomcat-8.0/bin/startup.sh
#tailf /root/tomcat-8.0/logs/catalina.out
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

例如:

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

securerandom.source=file:/dev/urandom

替换成

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

看完了这篇文章,相信你对“Linux服务器tomact 8.0启动慢怎么办”有了一定的了解,如果想了解更多相关知识,欢迎关注亿速云行业资讯频道,感谢各位的阅读!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI