tomcat启动卡住
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了tomcat启动卡住相关的知识,希望对你有一定的参考价值。
新部署的项目启动tomcat后一直停在org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.16,卡在了org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/host-manager]
将近7分钟。
[[email protected] bin]# tail -500f ../logs/catalina.2018-07-04.out
......
04-Jul-2018 16:28:59.520 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 328 ms
04-Jul-2018 16:28:59.534 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
04-Jul-2018 16:28:59.534 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.16
......
卡了近7分钟
......
04-Jul-2018 16:35:00.238 WARNING [localhost-startStop-1] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [360,548] milliseconds.
04-Jul-2018 16:35:00.273 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/host-manager]
....
解决方法:
修改jdk的java.security文件securerandom.source项
[[email protected] bin]# grep "source=file" /usr/java/jdk1.8.0_161/jre/lib/security/java.security
#securerandom.source=file:/dev/random
securerandom.source=file:/dev/./urandom
[[email protected] bin]#
将securerandom.source=file:/dev/random修改为securerandom.source=file:/dev/./urandom
linux或者部分unix系统提供随机数设备是/dev/random 和/dev/urandom ,两个有区别,urandom安全性没有random高,但random需要时间间隔生成随机数。jdk默认调用random。可通过 head -n 1 /devrandom 查看是否的系统会出现伪随机数提供等待,
以上是关于tomcat启动卡住的主要内容,如果未能解决你的问题,请参考以下文章
诡异问题:tomcat启动一直卡住,strace跟踪提示apache-tomcat核心文件找不到。