本文共 1670 字,大约阅读时间需要 5 分钟。
新部署的项目启动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 ms04-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/randomsecurerandom.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 查看是否的系统会出现伪随机数提供等待,
转载于:https://blog.51cto.com/ityunwei2017/2136206