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

질문됨 일 년 전1074회 조회
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
답변함 일 년 전
  • 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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠