Quickly solve the problem of slow startup after Tomcat reconfiguration

Quickly solve the problem of slow startup after Tomcat reconfiguration

During the configuration of Jenkins+Tomcat server, the tomcat configuration file was modified; then when I accessed the tomcat page of the server, I found that it could not be loaded at all

Attempt to restart tomcat

/opt/tomcat/bin/shutdown.sh

The following error occurs

[root@izbp1fmfc2pdjiw9u143xfz conf]# /opt/tomcat/bin/shutdown.sh Using CATALINA_BASE: /opt/tomcat Using CATALINA_HOME: /opt/tomcat Using CATALINA_TMPDIR: /opt/tomcat/temp Using JRE_HOME: /usr/lib/jvm/java-1.8.0-openjdk Using CLASSPATH: /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar 二月20, 2020 1:37:22 下午org.apache.catalina.startup.Catalina stopServer 严重: Could not contact [localhost:8005]. Tomcat may not be running. 二月20, 2020 1:37:22 下午org.apache.catalina.startup.Catalina stopServer 严重: Catalina.stop: java.net.ConnectException: 拒绝连接(Connection refused) at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:607) at java.net.Socket.connect(Socket.java:556) at java.net.Socket.<init>(Socket.java:452) at java.net.Socket.<init>(Socket.java:229) at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:504) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:389) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:479)

After verification, the reason for this error is that Tomcat has not yet been started;

Next I tried to force shut down Tomcat

ps -ef | grep tomcat View the tomcat process number kill -9 + process number to kill the process

Restart tomcat

/opt/tomcat/bin/startup.sh

Tomcat page still cannot be loaded

Print tomcat running log

[root@izbp1fmfc2pdjiw9u143xfz conf]# cd /opt/tomcat [root@izbp1fmfc2pdjiw9u143xfz tomcat]# ls bin BUILDING.txt conf CONTRIBUTING.md lib LICENSE logs NOTICE README.md RELEASE-NOTES RUNNING.txt temp webapps work [root@izbp1fmfc2pdjiw9u143xfz tomcat]# cd logs [root@izbp1fmfc2pdjiw9u143xfz logs]# ls catalina.2020-02-20.log host-manager.2020-02-20.log localhost_access_log.2020-02-20.txt catalina.out localhost.2020-02-20.log manager.2020-02-20.log [root@izbp1fmfc2pdjiw9u143xfz logs]# tail -f catalina.out 20-Feb-2020 13:48:35.239 信息[main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/tomcat 20-Feb-2020 13:48:35.239 信息[main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/tomcat 20-Feb-2020 13:48:35.239 信息[main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/tomcat/temp 20-Feb-2020 13:48:35.239 信息[main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib] 20-Feb-2020 13:48:35.348 信息[main] org.apache.coyote.AbstractProtocol.init 初始化协议处理器["http-nio-8080"] 20-Feb-2020 13:48:35.391 信息[main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 20-Feb-2020 13:48:35.403 信息[main] org.apache.catalina.startup.Catalina.load Initialization processed in 895 ms 20-Feb-2020 13:48:35.487 信息[main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina] 20-Feb-2020 13:48:35.487 信息[main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.51 20-Feb-2020 13:48:35.524 信息[localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory 把web 应用程序部署到目录[/opt/tomcat/webapps/docs]

The running log is found to be stuck at the last line: localhost-startStop-1 , and cannot continue downward

Solution:

Modify the securerandom.source parameter in the $ JAVA_HOME / jre / lib / security / java.security file to the file: /dev/./urandom

[root@izbp1fmfc2pdjiw9u143xfz logs]# cd $JAVA_HOME/jre/lib/security
[root@izbp1fmfc2pdjiw9u143xfz security]# ls
blacklisted.certs cacerts java.policy java.security nss.cfg policy
[root@izbp1fmfc2pdjiw9u143xfz security]# vi java.security

By the way, here is a quick way to search in vi:

In command mode, enter “/string”, for example, “/Section 3”. To search for the next one, just press "n".

Summarize

The above is the detailed content of how to quickly solve the problem of slow startup of Tomcat after reconfiguration. For more information about slow startup of Tomcat, please pay attention to other related articles on 123WORDPRESS.COM!

You may also be interested in:
  • Detailed analysis of when tomcat writes back the response datagram
  • In-depth analysis of Tomcat unresponsiveness issues and solutions
  • Solutions to the problem of spring scheduled tasks being executed twice and tomcat being deployed slowly
  • Solution to the slow startup of Tomcat8 in Linux system
  • Solution to the problem that SecureRandom is very slow when Tomcat starts
  • Analysis and solution of slow access to Tencent Cloud Ubuntu server Tomcat
  • Solution to slow response of Tomcat server

<<:  Detailed tutorial on installing MYSQL under WINDOWS

>>:  Using Vue to implement timer function

Recommend

Tutorial on using hyperlink tags in XHTML

Hyperlink, also called "link". Hyperlin...

Solution to HTML2 canvas SVG not being recognized

There is a new feature that requires capturing a ...

DOCTYPE Document Type Declaration (Must-Read for Web Page Lovers)

DOCTYPE DECLARATION At the top of every page you w...

React implements infinite loop scrolling information

This article shares the specific code of react to...

Native js canvas to achieve a simple snake

This article shares the specific code of js canva...

How to convert rows to columns in MySQL

MySQL row to column operation The so-called row-t...

react-diagram serialization Json interpretation case analysis

The goal of this document is to explain the Json ...

MySql 8.0.11 installation and configuration tutorial

Official website address: https://dev.mysql.com/d...

MySQL5.7 single instance self-starting service configuration process

1.MySQL version [root@clq system]# mysql -v Welco...

Detailed explanation of top command output in Linux

Preface I believe everyone has used the top comma...

Two ways to start Linux boot service

Table of contents rc.local method chkconfig metho...