解決Linux伺服器tomact-8.0啟動慢的問題,linuxtomact-8.0

來源:互聯網
上載者:User

解決Linux伺服器tomact-8.0啟動慢的問題,linuxtomact-8.0

環境資訊:

CentOS release 6.8

tomcat-8.0

JDK1.8

一、啟動tomcat

#sh /root/tomcat-8.0/bin/startup.sh

#tailf /root/tomcat-8.0/logs/catalina.out

26-Aug-2017 12:58:31.661 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read26-Aug-2017 12:58:31.662 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 680 ms26-Aug-2017 12:58:31.685 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina26-Aug-2017 12:58:31.685 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.3226-Aug-2017 12:58:31.695 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /root/tomcat-8.0/webapps/ROOT26-Aug-2017 12:58:36.184 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.26-Aug-2017 12:58:37.895 INFO [localhost-startStop-1] java.util.prefs.FileSystemPreferences$2.run Created system preferences directory in java.home.26-Aug-2017 12:58:37.897 INFO [localhost-startStop-1] java.util.prefs.FileSystemPreferences$1.run Created user preferences directory.26-Aug-2017 12:58:37.907 WARNING [localhost-startStop-1] java.util.prefs.FileSystemPreferences$6.run Prefs file removed in background /root/.java/.userPrefs/prefs.xml26-Aug-2017 12:58:37.908 WARNING [localhost-startStop-1] java.util.prefs.FileSystemPreferences$6.run Prefs file removed in background /root/jdk-1.8/jre/.systemPrefs/prefs.xml

... ...

等待tomcat啟動的過程是煎熬的,足足5/6分鐘,在不抱希望的情況下它居然又啟動完成了......

 

有兩種解決辦法:

1)在Tomcat環境中解決

在catalina.sh中加入這麼一行:

-Djava.security.egd=file:/dev/./urandom

例如:

JAVA_OPTS="-server -Xms2048m -Xmx4096m -XX:PermSize=256M -XX:MaxPermSize=512m -Djava.security.egd=file:/dev/./urandom"

2)在JVM環境中解決

修改$JAVA_PATH/jre/lib/security/java.security

securerandom.source=file:/dev/urandom

替換成

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

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.