Linux environment tomcat release system

Table of contents

1. Upload the war package that needs to be released

2. View the current java thread

3. Kill the java thread of the service that needs to be started

3. Modify the uploaded war package name and delete the original code package

4. Restart the program

5. View the startup log

1. Upload the war package that needs to be released

Upload the war package to the server tomcat -->webapps directory through XFTP.

Note that you can rename it first when uploading, for example: rename order.war to order.war.20230106 so that the original war package will not be overwritten, and it is convenient to roll back the code when necessary.

Wait for the package to be uploaded successfully before performing the following operations! ! !

2. View the current java thread

Command: ps aux | grep java 

The following figure is the thread ID corresponding to the java service

3. Kill the java thread of the service that needs to be started

Command: kill -9 3676

There will be no prompt after this step is executed. You can check whether the thread has been killed by viewing the thread command.

3. Modify the uploaded war package name and delete the original code package

Rename the current version of the war package to the upload time and keep it as a record. Note that it must be added after war. (Example: order.war.20230106)

Remove the date and version number from the war package uploaded this time.

cd / Find the webapps directory under tomcat.

Command: rm -r order Delete the original code decompression package order is the current war package decompression package

4. Restart the program

cd / Jump to the tomcat bin directory

Command: ./startup.sh to start the service

5. View the startup log

cd / Jump to the tomcat logs directory to view the startup log

Command: tail -200f catalina.out

The following figure shows the executed command:

Supongo que te gusta

Origin blog.csdn.net/qq_37570710/article/details/128573070
Recomendado
Clasificación