EC2如期启动 [英] EC2 startup on schedule

查看:23
本文介绍了EC2如期启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在每天(比如说)早上 6 点启动一个 EC2 实例.限制是我不想让计算机整天运行来启动或使用像 ylastic 这样的付费解决方案.

alestic 的解决方案是迄今为止最接近的.此解决方案的缺点是启动时间很长,因为安装自定义软件和移动数据需要时间.

有没有办法只启动一个实例而不是每次都创建一个新实例,如本示例?

解决方案

很遗憾,鉴于您的限制,所需的功能并未包含在 AWS 产品 &服务现在:

  • Auto Scaling - 是一种 Web 服务,旨在根据用户定义的策略、计划和运行状况检查自动启动或终止Amazon Elastic Compute Cloud (Amazon EC2) 实例.
  • AWS CloudFormation - 为开发人员和系统管理员提供了一种简单的方法创建和管理一组相关的 AWS 资源,以有序和可预测的方式供应和更新.

虽然启动/停止/重启实例在概念上属于后者的管理类别,但它不是这样可用的(顺便说一句,这也是我们专门为此功能提供单独任务的原因)同时已弃用的 Bamboo AWS 插件 及其继任者 AWS 任务).

因此,我在对如何在办公时间打开/关闭云实例的回答中概述的方法仍然适用,尽管有额外的限制,您需要找到免费托管您的脚本或持续集成解决方案的提供商:

  • 托管脚本有例如通过这些 cron 作业提供程序已经有一段时间了.

  • 鉴于目前平台即服务 (PaaS) 解决方案在那里的爆炸式增长是相当多的提供商,它们将允许您以一种或另一种方式执行主机脚本和/或持续集成解决方案.

显然,您需要根据相应的相关提供商的使用条款.

I need to start up an EC2 instance at (say) 6am every day. The constraints are that I'd like to avoid having a computer running all day to do the startup or use a paid solution like ylastic's.

The solution at alestic, is the closest so far. The downside of this solution is that the startup time is high because of the time required to install custom software and to move around data.

Is there a way to just boot up an instance instead of creating a new instance each time as shown in this example?

解决方案

Given your constraints, the desired functionality is unfortunately not covered by the two dedicated automation mechanisms available as AWS Products & Services right now:

  • Auto Scaling - is a web service designed to automatically launch or terminate Amazon Elastic Compute Cloud (Amazon EC2) instances based on user-defined policies, schedules, and health checks.
  • AWS CloudFormation - gives developers and systems administrators an easy way to create and manage a collection of related AWS resources, provisioning and updating them in an orderly and predictable fashion.

While starting/stopping/rebooting an instance conceptually falls into the manage category of the latter, it is not available like so (which incidentally is the reason we provide a separate Task specifically for this functionality within the meanwhile deprecated Bamboo AWS Plugin and its successor Tasks For AWS).

Consequently the approaches outlined in my answer to How to turn on/off cloud instances during office hours are still applicable, albeit with the additional constraint that you would need to find a provider hosting your script or continuous integration solution for free:

  • Hosting scripts has e.g. been possible for quite a while already by means of those cron job providers.

  • Given the current explosion in Platform as a Service (PaaS) solutions there are quite some providers, that will allow you to do host scripts and/or continuous integration solutions one way or another as well.

Obviously you'll need to verify, whether using the free tiers available for purposes like this is acceptable according to the respective Terms of Use of a provider in question.

这篇关于EC2如期启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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