首页 > 其他 > 详细

tomcat启动卡住

时间:2018-07-04 17:27:34      阅读:210      评论:0      收藏:0      [点我收藏+]
新部署的项目启动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分钟。

[root@app-web-2-64-0002 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项

[root@app-web-2-64-0002 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
[root@app-web-2-64-0002 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启动卡住

原文:http://blog.51cto.com/ityunwei2017/2136206

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!