亚马逊EC2自动缩放来与正常关闭? [英] Amazon EC2 autoscaling down with graceful shutdown?

查看:208
本文介绍了亚马逊EC2自动缩放来与正常关闭?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在寻找使用EC2自动缩放处理负载峰值。在我们的例子中,我们想扩大规模的基础上的SQS队列大小实例,然后下来的队列大小规模控制回来。每个SQS消息定义了一个潜在的长期运行的工作(有时可达每一个消息20分钟)必须完成的实例可以被终止了。

We're looking at using EC2 autoscaling to deal with spikes in load. In our case we want to scale up instances based on an SQS queue size and then down scale with the queue size gets back under control. Each SQS message defines a potentially long running job (sometimes up to 20 minutes each for message) that must complete before the instance can be terminated.

我们的软件处理关机过程正常,所以发出 sudo的服务ourapp停止将等待应用程序返回前完成。

Our software handles the shutdown process gracefully, so issuing sudo service ourapp stop will wait for the app to complete before returning.

我的问题;自动缩放开始时缩小它发出终止(这显然是像打了电源键),将它等待我们的应用程序,以完全退出之前,该实例关机?

My question; when autoscaling starts scaling down it issues a terminate (which apparently is like hitting the power button), will it wait for for our app to completely exit before the instance is 'powered off'?

<一个href="https://forums.aws.amazon.com/message.jspa?messageID=180674">https://forums.aws.amazon.com/message.jspa?messageID=180674 &LT; - 这一点,我已经找到了其他的东西似乎表明,它没有

https://forums.aws.amazon.com/message.jspa?messageID=180674 <- that and other things I've found seem to suggest that it doesn't

推荐答案

在1014年年中推出AWS生命周期挂钩',这可以完全控制终端的过程。

In mid 1014 AWS introduced 'lifecycle hooks' which allows for full control of the termination process.

我们的高水平下降规模的过程是:

Our high level down scale process is:

  • 自动缩放将消息发送到一个SQS队列与实例ID
  • 在控制器的应用程序可拾取邮件
  • 在控制器应用程序发出了停止实例的要求
  • 在控制器应用程序重新排队的SQS消息,而实例停止
  • 在控制器应用拿起消息再次,检查是否实例已停止(或重新排队的消息,稍后再试)
  • 在控制器应用程序通知自动缩放到PROCEED的终止
  • 在控制器应用程序中删除从SQS队列中的消息

更多细节:的http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/introducing-lifecycle-hooks.html

这篇关于亚马逊EC2自动缩放来与正常关闭?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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