我正在開展一個小項目,以熟悉亞馬遜網絡服務。我試圖做一個簡單的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