The Tomcat service deployed on the Linux server usually needs to be restarted when the project is updated, but Tomcat may fail to start due to various reasons. This article will use the Linux distribution centOS 7 system as an example to introduce two types of Tomcat startup failures. troubleshooting ideas.
How to solve the problem of Tomcat startup failure in CentOS
Usually there are two reasons for Tomcat startup failure in CentOS:
1. Insufficient disk space
2. Tomcat port is occupied
The specific solution is as follows:
1. Check the overall disk of the server Usage (recommended learning:Linux Video Tutorial)
df -h
If the server does not have other large file storage, the high disk usage may be caused by too many log files, and you can delete some appropriately log file, and then restart Tomcat
Tomcat log file location: In the logs directory under the Tomcat installation directory
Command to check the space occupied by the Tomcat log file (enter the Tomcat directory first)
For example
du -sh /usr/tomcat8/logs
2. The Tomcat port is occupied
Check the port occupancy of Tomcat
ps -ef |grep tomcat
Check the process number such as 1333
ps aux |grep 1333
ls -l /proc/1333This command can find the absolute path of the running program
If Tomcat fails to start because the port is occupied, just close the corresponding program/process
Close the process
kill -9 1333
1333 is the process id (pid)
After the process is killed, restart Tomcat
This article comes from PHP Chinese website,CentOS Use the Tutorialcolumn, please pay attention to this column for more related tutorials!
The above is the detailed content of How to solve the problem of Tomcat startup failure in CentOS. For more information, please follow other related articles on the PHP Chinese website!