解决centos6.8-JDK(JRE)1.7.0_80-tomcat7.0上tomcat启动时间过长

在linux上搭建一个生产环境的时候,tomcat,jdk都安装完好,问题就是启动tomcat需要耗时3-5分钟以上。
找了好多种方式。终于可以了。具体原理还不是清楚。
解决方案是:

$java_PATH/jre/lib/security/java.security
中的

securerandom.source=file:/dev/urandom

替换为:

securerandom.source=file:/dev/./urandom

新编译jdk环境:
执行:

source ~/.bashrc

根本原因

In this implementation, the generator keeps an estimate of the number of bits of noise in the entropy pool. From this entropy pool random numbers are created. When read, the /dev/random device will only return random bytes within the estimated number of bits of noise in the entropy pool. /dev/random should be suitable for uses that need very high quality randomness such as one-time pad or key generation.

When the entropy pool is empty, reads from /dev/random will block until additional environmental noise is gathered. The intent is to serve as a cryptographically secure pseudorandom number generator, delivering output with entropy as large as possible. This is suggested for use in generating cryptographic keys for high-value or long-term PRotection. http://en.wikipedia.org/wiki//dev/random#linux

然后就可以啦!

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值