tomcat 启动因为随机数启动慢

Posted on Posted in tomcat

方法1:

vim $JAVA_HOME/jre/lib/security/java.security
securerandom.source=file:/dev/random
# 改为
securerandom.source=file:/dev/urandom

方法2:

vim $TOMCAT_HOME/bin/catalina.sh
if [[ "$JAVA_OPTS" != *-Djava.security.egd=* ]]; then
    JAVA_OPTS="$JAVA_OPTS -Djava.security.egd=file:/dev/urandom"
fi

这个系统属性egd表示熵收集守护进程(entropy gathering daemon)

方法3:

# 安装rngd服务(熵服务,增大熵池)
yum install rng-tools 
systemctl start rngd  
# 启动服务
相关文章

Leave a Reply

Your email address will not be published. Required fields are marked *

one × 3 =