(亲测解决)Tomcat启动时卡在“ Deploying web application directory ”很久的解决方法
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash

·
目录
一、问题描述
今天在实用阿里云的CentOS7搭建Tomcat的时候,当启动服务器的时候发现要很久网页才能访问,一看日志发现卡在Deploying web application directory这个位置
二、问题原因
linux或者部分unix系统提供随机数设备是/dev/random 和/dev/urandom,其中urandom安全性没有random高,但random需要时间间隔生成随机数,jdk默认调用random,从而生成随机数时间间隔长从而到时Tomcat启动速度慢
三、问题解决
1.既然是因为random导致速度变慢,所以可以JDK生成随机数的random改为.urandom
2.随机数文件在jdk1.8.0_151/jre/lib/security/java.security文件中,所以先进入到文件所在目录
·Linux(示例参考):/usr/local/jdk1.8.0_151/jre/lib/security
[root@tianxin security]# cd /usr/local/jdk1.8.0_151/jre/lib/security
·Windows(示例参考):D:\jdk1.8.0_151\jre\lib\security
3.修改java.security,找到行securerandom.source=file:/dev/random修改为securerandom.source=file:/dev/./urandom,然后保存退出
[root@tianxin security]# vim java.security
4.重新启动服务器,问题解决




A beautiful web dashboard for Linux
最近提交(Master分支:7 个月前 )
186a802e
added ecosystem file for PM2 5 年前
5def40a3
Add host customization support for the NodeJS version 5 年前
更多推荐
所有评论(0)