tomcat启动日志:
Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [39,402] milliseconds.
2种解决方案:
1. 在Tomcat环境中解决:
可以通过配置 JRE 使用非阻塞的 Entropy Source:
在 catalina.sh 中加入这么一行:-Djava.security.egd=file:/dev/./urandom 即可。
2. 在 JVM 环境中解决:
打开 $JAVA_PATH/jre/lib/security/java.security 这个文件,找到下面的内容:
securerandom.source=file:/dev/random
替换成:
securerandom.source=file:/dev/./urandom
重启服务即可。