IO Error: Connection reset by peer, Authentication lapse 140354 ms.問題的解決

今天在公司服務器上搭建新環境,部署項目時,一切準備就緒了,但是卻發現項目總是啓動失敗,啓動日誌報:“IO Error: Connection reset by peer, Authentication lapse 140354 ms…”這個錯誤。
因爲這個錯誤是在數據庫連接時報出來的,我第一反應是數據庫連接異常——權限問題,可能是密碼或用戶名有誤,找了dba確認密碼,用戶名無誤後,就開始尋找其他突破口,google是個好東西,oracle官網給出來了一個解決方案,如下:

#oracle文檔的地址
https://docs.oracle.com/cd/E13209_01/wlcp/wlss30/configwlss/jvmrand.html

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 WebLogic SIP Server 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, BEA recommends using /dev/urandom if the default JVM configuration delays WebLogic SIP Server 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
If the command returns immediately, you can use /dev/random as the default generator for SUN’s JVM. If the command does not return immediately, use these steps to configure the JVM to use /dev/urandom:
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.

我來試着給大家翻譯一下:

避免因隨機數生成而導致的JVM延遲
在UNIX平臺上,Sun的JVM中用於隨機數生成的庫默認依賴於/ dev / random。可能會阻止WebLogic SIP Server進程,因爲在某些操作系統上/ dev / random會在返回結果之前等待主機上產生一定量的“干擾”。儘管/ dev / random更安全,但如果默認JVM配置延遲WebLogic SIP Server啓動,BEA建議使用/ dev / urandom。
要確定你的操作系統是否出現此行爲,請嘗試在shell提示符下顯示該文件的一部分:
head -n 1 / dev / random如果命令立即返回,則可以使用/ dev / random作爲SUN JVM的默認生成器。如果命令未立即返回,請使用以下步驟將JVM配置爲使用/ dev / urandom:
在文本編輯器中打開$ JAVA_HOME / jre / lib / security / java.security文件。
更改這一行配置:securerandom.source = file:/ dev / random
改爲這個:securerandom.source = file:/ dev / urandom
保存更改並退出文本編輯器。

我試了,確實解決了tomcat服務啓動異常的問題。如果有遇到相同問題的,可以試着這樣解決。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章