The EC2 server shut down

0

The server freezes completely when trying to run a jar file compiled with dependencies of the spring boot framework. Actions performed

  1. Java 17 (openjdk 17.0.9) was previously installed using yum via putty
  2. The jar files have been copied to the /opt/pis/ folder on the server, collected for spring boot using WinSCP. The files were checked on the local machine - everything is started via the java -jar <filename> command.
  3. The java -jar <file name> command is executed using putty. The terminal displays messages that spring is running and has started initialization, but it freezes at some stage. At the same time, access via ssh (in putty), sftp (WinSCP) and the MySQL Workbench client is lost. Through the AWS console, the browser also writes an error that it cannot connect. There should be enough memory, since the jar running on the local machine takes up 221 MB of memory. There are no signs on the instance panel in the AWS console that the server is frozen, but there is no access to it at all.

I tried to do a Reboot for Instance - there is no reaction. Next, I tried to make a stop instance, and then start instance - the server rebooted, but changed the public ip address. After that, access appeared again. I tried to start the jar again, the server has been frozen again.

How can I find out the reason why the server is freezing and shutting down? According to the information in the console, it is not clear. Or how i can fix it ?

Alex
已提問 5 個月前檢視次數 197 次
2 個答案
1

Hello.

It should be possible to check the EC2 system log by following the steps in the document below.
Check this log and if you see an OOM error, there is a high possibility that there is insufficient memory, so please try increasing the instance size.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-console.html#instance-console-console-output

We also recommend checking the EC2 metrics to see if there are any unnatural parts.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html

profile picture
專家
已回答 5 個月前
0

At the and of the day we reinstalled instance with Amazon Linux (before Linux Red hut was installed on our server). We also tried to use containers with Docker - but it did not help - Java jar file was freezing. Now jar file is up and running without any problems directly without containers. We installed also Java 21 instead of Java 17

Alex
已回答 4 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南