Detailed explanation of the infinite restart problem when running the SpringBoot project docker environment

Detailed explanation of the infinite restart problem when running the SpringBoot project docker environment

Maybe I started to think wrongly, and my description of the problem may be a bit messy, but I hope the possible solutions here can help others who encounter the same pit as me.

Description: The springboot project runs in the docker image. Looking at the docker log, after the project is successfully started, it automatically restarts after about a minute, causing nginx to report 502 gateway or something when the website interface is accessed. There are two servers, one is a file server, running very simple code for uploading and downloading files and verifying tokens, and the other runs a java application. Both servers are updating the project image at the same time. After running, this problem is encountered, which is very strange.

Then I made the project into a jar package and ran it directly in the application server using java -jar xxx.jar. Then it got stuck in some places and could not continue to start, or it showed that it had been killed.

Image A

We suspected that the project memory leaked, causing the process to be killed by the system, so we changed to the previous docker image, and the result was the same. We suspected that the nginx configuration had changed, but it still didn't work. Then we changed to our own Alibaba Cloud server to run the latest image, and there was no problem. It was completely normal. Running the jar package in Alibaba Cloud was also normal. So we suspected that the system might have changed and caused this problem. So we took a look at top and found

The CPU usage is too high. There is an unknown process that is very abnormal. I searched on Baidu and found out what command this cornd executes regularly, so I tried to solve it. (ps: And this is not installed by us, and we have never done this in the online environment)

First check the status: systemctl status crond

Then see which commands are configured: crontab -e

I changed the 0. It was * before. I changed it to 0, then saved and exited.

Then stop the service: systemctl stop crond

Finally, check top. If the process still exists, kill it directly, and then ojbk it. It's a bummer. It took me half a day to figure it out.

This is the end of this article about the infinite restart problem when running in the docker environment of the SpringBoot project. For more related SpringBoot docker infinite restart content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed tutorial on running multiple Springboot with Docker
  • How to run the springboot project in docker
  • Implementation of running springboot project with Docker

<<:  How to use async await elegantly in JS

>>:  How to implement mask layer in HTML How to use mask layer in HTML

Recommend

Differences between FLOW CHART and UI FLOW

Many concepts in UI design may seem similar in wo...

MySQL common statements for viewing transactions and locks

Some common statements for viewing transactions a...

Some functions of using tcpdump to capture packets in the Linux command line

tcpdump is a flexible and powerful packet capture...

Summary of common problems and application skills in MySQL

Preface In the daily development or maintenance o...

Detailed explanation of three solutions to the website footer sinking effect

Background Many website designs generally consist...

How MySQL Select Statement is Executed

How is the MySQL Select statement executed? I rec...

Complete steps for Nginx to configure anti-hotlinking

need: Usually, sites want to prevent videos and p...

Input file custom button beautification (demo)

I have written such an article before, but I used...

MySQL aggregate function sorting

Table of contents MySQL result sorting - Aggregat...

MySQL InnoDB MRR Optimization Guide

Preface MRR is the abbreviation of Multi-Range Re...

CSS example code for implementing sliding doors

The so-called sliding door technology means that ...

Steps to install MySQL 5.7 in binary mode and optimize the system under Linux

This article mainly introduces the installation/st...