[localhost-startStop-1]
第一次遇到Tomcat在Linux服务器启动卡住的情况,情况很简单,tomcat启动以后卡在INFO: Deploying web application directory ......这句话,具体会卡多久就没测试了。google、baidu都没找到解决方法。
幸亏UCloud的技术支持人员给出了解决方案。
找到jdk1.x.x_xx/jre/lib/security/java.security文件,在文件中找到securerandom.source这个设置项,将其改为:
securerandom.source=file:/dev/./urandom
这时候根据修改内容就可以查到因为此原因不仅可以造成tomcat卡住,也会造成weblogic启动缓慢,
linux或者部分unix系统提供随机数设备是/dev/random 和/dev/urandom ,两个有区别,urandom安全性没有random高,但random需要时间间隔生成随机数。jdk默认调用random。
再后来,终于在weblogic的官方文档中 Monitoring and Troubleshooting 找到了 Avoiding JVM Delays Caused By Random Number Generation 这样一个标题。摘录如下:
The library used for random number generation in Sun's JVM relies on /dev/random by default for UNIX platforms. This can potentially block the Oracle WebLogic Communication Services process because on some operating systems /dev/random waits for a certain amount of "noise" to be generated on the host machine before returning a result. Although /dev/random is more secure, Oracle recommends using /dev/urandom if the default JVM configuration delays Oracle WebLogic Communication Services startup.
To determine if your operating system exhibits this behavior, try displaying a portion of the file from a shell prompt:
head -n 1 /dev/random
Open the $JAVA_HOME/jre/lib/security/java.security file in a text editor.
Change the line:
securerandom.source=file:/dev/random
to read:
securerandom.source=file:/dev/urandom
Save your change and exit the text editor.
其中说到:可通过 head -n 1 /devrandom 查看是否你的系统会出现伪随机数提供等待。OK就这个,试了一下,果然,在服务器第一次启动后,这个可以快速提供一个值,但当再次调用时发生等待。
解决办法:
永久:oracle 说修改 $JAVA_HOME/jre/lib/security/java.security 文件,替换securerandom.source=file:/dev/random 为 securerandom.source=file:/dev/urandom。对所有使用JVM的应用生效。(这个永久的方法,这里面有个问题,就是设置时候实际应该设置为securerandom.source=file:/dev/./urandom,否则不生效)
DOMAIN临时:修改startWeblogic.sh文件,JAVA_OPTIONS="${SAVE_JAVA_OPTIONS} -Djava.security.egd=file:/dev/./urandom"
[localhost-startStop-1]的更多相关文章
- zookeeper报错java.net.ConnectException: Connection refused: no further information
zookeeper报错java.net.ConnectException: Connection refused: no further information 这是在linux 启动 https:/ ...
- 2003-Can't connect to mysql server on localhost (10061)
mysql数据库出现2003-Can't connect to mysql server on localhost (10061)问题 解决办法:查看wampserver服务器是否启动,如果没有启动启 ...
- MySql Access denied for user 'root'@'localhost' (using password:YES) 解决方案
关于昨天下午说的MySQL服务无法启动的问题,解决之后没有进入数据库,就直接关闭了电脑. 今早打开电脑,开始-运行 输入"mysql -uroot -pmyadmin"后出现以下错 ...
- Server Tomcat v7.0 Server at localhost was unable to start within 45 seconds
错误:Server Tomcat v7.0 Server at localhost was unable to start within 45 seconds 错误提示就是我们限定了部署的时间导致的错 ...
- ssh无密码登录The authenticity of host 'localhost (::1)' can't be established.
The authenticity of host 'localhost (::1)' can't be established. http://blog.csdn.net/cyuyan112233/a ...
- phpmyadmin #1045 - Access denied for user 'root'@'localhost' (using password: NO)
phpmyadmin访问遇到1045问题 #1045 - Access denied for user 'root'@'localhost' (using password: NO) 解决办法 找到p ...
- eclipse启动tomcat, http://localhost:8080无法访问
原地址 症状: tomcat在eclipse里面能正常启动,而在浏览器中访问http://localhost:8080/不能访问,且报404错误.同时其他项目页面也不能访问. 关闭eclipse里面的 ...
- 解决ssh localhost中root@localhost:要求输入密码问题(已经进行了无密码设置登录)
首先删除~/.ssh目录下的3个文件,如下 id_rsa authorized_keys id_rsa.pub 然后 exit # 退出刚才的 ssh localhostcd ~/.ssh/ # 若没 ...
- MySql数据库:Host 'localhost' is not allowed to connect to this MySQL server
修改mysql的root密码后,出现Host 'localhost' is not allowed to connect to this MySQL server 错误. 解决办法: C:\Progr ...
- 诡异的localhost无法连接
上午试了localhost发现提示无法连接,ping了下localhost,能够ping通. 重启了Apache,还是无法解决. 试着停止了Apache服务,然后再连接localhost,发现浏览器提 ...
随机推荐
- vulnhub靶场之VENOM: 1
准备: 攻击机:虚拟机kali.本机win10. 靶机:Venom: 1,下载地址:https://download.vulnhub.com/venom/venom.zip,下载后直接vbox打开即可 ...
- tomcat8 性能优化参考
https://www.jianshu.com/p/c770c1e97531 tomcat8 性能优化参考
- 基于遗传算法的地图四色原理绘图上色的Python代码
本文介绍利用Python语言,实现基于遗传算法(GA)的地图四色原理着色操作. 1 任务需求 首先,我们来明确一下本文所需实现的需求. 现有一个由多个小图斑组成的矢量图层,如下图所示. ...
- spring in action day-06 JMS -ActiveMQ Artemi
JMS -ActiveMQ Artemi JMS:它是一个规范,类似于jdbctemplate Spring提供了jmstemplate来发送和接收消息. 搭建JMS环境 1.引入依赖 我们要使用的消 ...
- docker02-centos上安装
1.前提说明Docker 运行在 CentOS 7 上,要求系统为64位.系统内核版本为 3.10 以上.Docker 运行在 CentOS-6.5 或更高的版本的 CentOS 上,要求系统为64位 ...
- JAVA8 常见用法
1 . 集合List<T> 去单个元素,返回集合 List<Tbhr01> tbhr01List = new ArrayList<Tbhr01>(); List&l ...
- T-SQL——将字符串转换为多列
目录 0. 使用ParseName 1. 具体到拆分为两列 2. 具体到拆分的指定的列数 志铭-2023年2月21日 0. 使用ParseName 注意:ParseName最多只能拆分为四列 Pars ...
- 三分钟使用chatGPT
ChatGPT最近也是火爆出圈,网上已被刷屏. 今天我们说一下,使用ChatGPT的方法,很简单,只需要三步: 前期确保自己能访问google,IP地址为某些国家:否则检查会报错:Services a ...
- [清华集训2016] Alice 和 Bob 又在玩游戏
\(\text{Solution}\) 第一道有向图 \(SG\) 函数的博弈论 有根树,设 \(f[x]\) 表示以 \(x\) 为根子树的 \(SG\) 值 对于分裂的图的 \(SG\) 值为每个 ...
- 生物标记钙卫蛋白在RA诊疗中的应用研究
标签: 类风湿关节炎; 预测因子; 钙卫蛋白; S100A9 [文献摘记]生物标记钙卫蛋白在RA诊疗中的应用研究 电邮发布日期:2016年4月20日 不断提升精确度和应用范围的组学技术正在帮助包括类风 ...