Does an EC2 gracefully shut down when I terminate it?

0

I have an EC2 instance that runs a spring boot java application as a service, meaning the service will automatically start up after the EC2 rebooted and will also automatically shut down when the stop action is called on the EC2 instance. But what happens when I terminate the EC2 instance? Will the java application running on the instance be allowed to gracefully shut down before the EC2 instance is terminated or are all process halted abruptly on termination?

I would also like to know how long a stopping EC2 instance will wait for a service to gracefully shut down and if there is a way to configure this waiting time.

Thanks

質問済み 1年前1072ビュー
1回答
0

According to the docs:

When an EC2 instance is terminated using the terminate-instances command, the following is
registered at the OS level:

* The API request will send a button press event to the guest.
* Various system services will be stopped as a result of the button press event. systemd handles a graceful shutdown of the system. Graceful shutdown is triggered by the ACPI shutdown button press event from the hypervisor.
* ACPI shutdown will be initiated.
* The instance will shut down when the graceful shutdown process exits. There is no configurable OS shutdown time.
profile pictureAWS
エキスパート
kentrad
回答済み 1年前
  • what is ment by 'guest'? Furthermore you say that there is no configurable shutdown time. Does that mean that the termination process will hang indefinately if the systemd process does not shutdown properly and hangs?

  • Hi Viridios, According to Amazon User Guide for Linux Instances, if the instance OS does not shut down cleanly within a few minutes, a hard shutdown is performed. Even so, If the instance remains in the shutting-down state for several hours, Amazon EC2 treats it as a stuck instance and forcibly terminates it.

  • The guest is your instance, from the hypervisor point of view.

  • The guest is your instance, from the hypervisor point of view.

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

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

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

関連するコンテンツ