无法正确停止我的AWS EC2实例 [英] Can't stop my AWS EC2 instance properly

查看:385
本文介绍了无法正确停止我的AWS EC2实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AWS的新手,我有一个t2.micro EC2实例支持我的Elastic Beanstalk应用程序。它是在我将WAR文件部署到Elastic Beanstalk时创建的。

Newbie to AWS, I have a t2.micro EC2 instance supporting my Elastic Beanstalk application. It was created while I deployed my WAR file to Elastic Beanstalk.

我的EB应用程序不需要每天运行24小时,因此只需要在特定时间段内运行即可。一天的时间。当我尝试通过选择操作->实例状态->停止从AWS EC2管理控制台停止它时,该实例被终止,但是创建并初始化了一个新实例,然后稍后自动运行。

My EB application does not need to run 24 hrs a day so it only needs to work during a specific period of time a day. When I tried to stop it from the AWS EC2 management console by selecting "Actions -> Instance state -> Stop", the instance was terminated instead but a new instance was created and initialized and then running automatically later.

如何适当停止EC2实例以满足自己的需要?谢谢。

How can I stop an EC2 instance properly to suit my need? Thanks.

推荐答案

您的EB应用程序正在利用Auto Scaling组来确保您的EC2实例保持运行。

Your EB application is utilizing an Auto Scaling group to ensure your EC2 instance stays running.

当您停止EC2实例时,Auto Scaling会将其视为不正常的实例并终止它,然后将其替换为新的,正常的实例。

When you stop your EC2 instance, Auto Scaling sees that as an unhealthy instance and terminates it, then replaces it with a new, healthy instance.

您无法停止属于Auto Scaling组的EC2实例。最好的办法是编辑Auto Scaling组策略,以设置 min = desired = 0 。这将终止实例并使其保持终止状态。当您想让实例再次运行时,请编辑Auto Scaling组并重置 min = desired = 1

You cannot stop EC2 instances that are part of an Auto Scaling group. The best you can do is to edit your Auto Scaling group policy to set min=desired=0. This will terminate the instance and keep it terminated. When you want to get your instance running again, edit your Auto Scaling group and reset min=desired=1.

这篇关于无法正确停止我的AWS EC2实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆