安排在AWS EC2一个作业 [英] Scheduling A Job on AWS EC2
问题描述
我对AWS EC2上运行一个网站。我需要创建一个生成网站地图文件,上传文件到不同的浏览器夜间作业。我正在寻找在AWS上一个实用工具,允许这项功能。我已经考虑了以下内容:
I have a website running on AWS EC2. I need to create a nightly job that generates a sitemap file and uploads the files to the various browsers. I'm looking for a utility on AWS that allows this functionality. I've considered the following:
1)产生一个请求,以触发它做这个任务web服务器
1) Generate a request to the web server that triggers it to do this task
- 我不喜欢这种方法,因为它占用了一个服务器线程和使用的CPU周期的主机上
2)创建的Web服务器上运行来执行这项任务的机器上的cron作业
2) Create a cron job on the machine the web server is running on to execute this task
- 同样,我不喜欢这种方法,因为它需要CPU周期远离Web服务器
3)创建另一个EC2实例,并成立一个cron作业运行的任务
3) Create another EC2 instance and set up a cron job to run the task
- 这解决了Web服务器资源问题,但为什么付出额外的EC2实例为&LT运行作业5分钟呢?白花钱!
是否还有其他选择吗?这是ElasticMa preduce工作?
Are there any other options? Is this a job for ElasticMapReduce?
推荐答案
亚马逊刚刚发布了[1]弹性青苗的新功能。现在,您可以创建一个包含cron.yaml的配置计划任务调用和cron语法的URL工人环境:<一href="http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-tiers.html#worker-periodictasks">http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-tiers.html#worker-periodictasks
Amazon has just released[1] new features for Elastic Beanstalk. You can now create a worker environment containing cron.yaml that configures scheduling tasks calling an URL with the CRON syntax: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-tiers.html#worker-periodictasks
[1] <一个href="http://aws.amazon.com/about-aws/whats-new/2015/02/17/aws-elastic-beanstalk-supports-environment-cloning-periodic-tasks-and-1-click-iam-role-creation/">http://aws.amazon.com/about-aws/whats-new/2015/02/17/aws-elastic-beanstalk-supports-environment-cloning-periodic-tasks-and-1-click-iam-role-creation/
这篇关于安排在AWS EC2一个作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!