Tomcat shutdown is invalid in linux. tomcatshutdown

Source: Internet
Author: User

Tomcat shutdown is invalid in linux. tomcatshutdown

Problem:

Tomcat shutdown is invalid in linux.

After tomcat is disabled in linux, it is found that the port number is occupied after Tomcat is restarted,

Cause:

This may be because the background thread or socket in the project is still running and the port number is occupied,

Solution:
①: Run $ netstat-pan | grep 2809 to check the port number,
You can use netstat-anp | grep 3306 to find the port number and kill the current PID process.

②: Disable the port through iptables

Iptables-a input-p tcp -- dport 111-j DROP

③: Disable port: lsof-I: 8080 | grep-v "PID" | awk '{print "kill-9", $2}' | sh

④: Repeated shutdown. sh can also be effective!



In linux, when I run shutdownsh, the tomcat service stops running, but the jdk PROCESS OF THE tomcat application is not stopped,

In general, shutdown. sh can be used to stop java processes. Sometimes it may take several dozen seconds for the java Process to be shut down. But sometimes the java Process will always exist due to java program problems, the process can only be killed. In this case, it seems that there is no other way to optimize the java program.
LZ must wait until the java Process of the existing tomcat is turned off and start tomcat again. Do not start multiple tomcat; otherwise, your application may have problems ----- the server port will be occupied by the previous process, tomcat started later does not work.

Why did I receive an error when I stopped tomcat in linux?

Catalina. out is missing.
You can create such a file by yourself.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.