Tomcat启动时Creation of SecureRandom instance for session ID很慢
解决方案有两种:
1、修改java.security文件
文件位置:$JAVA_HOME/jre/lib/security/java.security
打开并找到以下内容:
securerandom.source=file:/dev/random
修改为:
securerandom.source=file:/dev/urandom
2、添加参数java.security.egd=file:/dev/./urandom
在启动Tomcat时添加启动参数-Djava.security.egd=file:/dev/urandom
可在catalina.sh文件中添加
第一种已测试,第二种修改未做测试
(已迁移)
相关推荐
Tomcat 启动时 SecureRandom 非常慢解决办法 最近使用阿里云的 Ubuntu 16.04 ESC 服务器运行 Tomcat 时发现,Tomcat 启动的特别慢,通过查看日志,发现时间主要花在...SecureRandom instance for session ID generat
29-Oct-2015 15:52:53.587 INFO [localhost-startStop-1] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] ...
27-Aug-2017 15:52:53.587 INFO [localhost-startStop-1] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] ...
03-Jul-2018 08:58:22.411 INFO [localhost-startStop-1] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] ...
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [5172] milliseconds. 关于这个问题,Tomcat 7+版本中使用SecureRandom类来生成随机数,用于会话ID生成和其他地方。...