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ヶ月前198ビュー
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
回答済み 5ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ