我正在开展一个小项目,以熟悉亚马逊网络服务。我试图做一个简单的Web应用程序;当一个按钮被按下时,mapreduce作业被启动并且输出在浏览器上被返回。 什么是最好的方法来做到这一点?另外,有没有办法通过命令行启动亚马逊弹性mapreduce作业?远程启动Amazon Elastic MapReduce作业?
0
A
回答
2
您可以使用您正在编写Web应用程序的任何语言的AWS SDK来调用EMR来提交作业。我主要使用python工作,所以我最熟悉Python Boto库,这使得将代码和数据上传到s3,配置作业流并启动作业流程非常轻松。
您不会希望启动作业并在相同的HTTP请求中返回结果,因为只有在作业能够运行之前启动集群需要几分钟的时间。网页应用程序的页面不响应分钟不是一个好的用户体验。但是,只提交工作流程似乎只需要几秒钟。您需要创建作业流程,并只需跟踪Web应用程序中的作业流ID。给定一个作业流ID,当用户回来并且作业完成时,您不应该在检索日志数据或从作业流中输出时遇到太多麻烦。
这里是一个可以如何与博托推出的弹性MR作业的例子:
import boto
from boto.emr.step import StreamingStep
conn = boto.connect_emr()
step = StreamingStep(name='My wordcount example',
mapper='s3n://elasticmapreduce/samples/wordcount/wordSplitter.py',
reducer='aggregate',
input='s3n://elasticmapreduce/samples/wordcount/input',
output='s3n://<my output bucket>/output/wordcount_output')
jobid = conn.run_jobflow(name='My jobflow',
log_uri='s3://<my log uri>/jobflow_logs',
steps=[step])
0
你给这个看看了吗? http://developer.amazonwebservices.com/connect/entry.jspa?externalID=873它来自开发方,可能会帮助你。
+0
是的,我已经看到了。但是,如何通过Web应用程序远程调用shell脚本? – Kareem 2010-08-26 21:14:46
相关问题
- 1. Amazon Elastic MapReduce - SIGTERM
- 2. Amazon Elastic MapReduce:无法创建包含大量实例的作业流程
- 3. 如何远程运行mapreduce作业
- 4. Amazon Elastic MapReduce:来自FileSystem的异常
- 5. Amazon Elastic MapReduce的容量调度器
- 6. 使用bash远程启动作业
- 7. 是否可以使用.NET为Amazon Elastic MapReduce编写map/reduce作业?
- 8. 通过boto获取Amazon Elastic MapReduce作业流中已完成步骤的数量
- 9. Hive没有启动mapreduce作业..在执行过程中卡住
- 10. 如何在windows的amazon弹性mapreduce(emr)集群上运行mapreduce作业?
- 11. HbaseTestingUtility和MapReduce作业
- 12. 剖析MapReduce作业
- 13. 如何启动MapReduce程序?
- 14. Resque远程作业
- 15. 通过Python无PuTTy/SSH启动Hadoop MapReduce作业
- 16. Amazon Elastic Beanstalk Broadcast
- 17. 使用Karmasphere分析师和Amazon Elastic MapReduce设置jobconf参数
- 18. 获取在后台远程启动的作业的pid
- 19. 从eclipse启动远程点火作业时出错
- 20. 在远程CredSSP调用中启动作业时出现问题
- 21. 在Amazon Elastic Map Reduce中对Amazon DynamoDB的数据运行自定义MapReduce Jar
- 22. Ganglia和Amazon Elastic Map Reduce - 安装问题
- 23. Amazon Elastic Beansalk cron.yaml文件
- 24. 是否可以在Amazon Elastic MapReduce工作流中添加“组合”步骤?
- 25. Amazon EC2上的Hadoop:作业跟踪器无法正常启动
- 26. 使用Elastic MapReduce(PIG)处理CloudFront日志
- 27. 为MongoDB调度MapReduce作业
- 28. Avro Mapreduce作业失败org.apache.avro.AvroTypeException
- 29. 亚马逊MapReduce没有reducer作业
- 30. 远程执行Hudson作业
是的,谢谢迈克。最近我也一直在使用python。 boto和paramiko库对于创建集群并将它们运行以运行命令非常有用。 – Kareem 2011-02-24 19:59:25
没问题,Kareem。 :-)那么你是Python中的Web应用程序呢? – stderr 2011-02-24 20:02:22