Amazon EMR:在Amazon EMR中使用R代码

3

我有一个非常初级的问题。我刚刚阅读了一些关于亚马逊EMR的文档。在注册之前,我想问一下是否可以在其中使用R。

我有一个R模块,调用了几个其他模块,然后在完成运行之前将几个变量保存为.txt文件。

我的问题是,我能否在亚马逊EMR中做到这一点?我能够访问.txt输出文件吗?最后,我的R脚本从Excel电子表格中读取一些数据。如果我将Excel文件上传到系统中,它仍然能够执行吗?

谢谢

Mike


不清楚emr如何与R脚本启动相关联?你知道Hadoop是什么以及Map-Reduce模式如何工作吗? - alko
@alko,我只知道我最近读到的。我的理解是Hadoop和map-reduce模式将多台计算机的计算能力分散(即将进程映射到多台计算机),然后在最后将结果聚合到一个系统上(即减少它)。这正确吗?从那里开始,我看了看亚马逊EMR系统,它似乎表明可以使用流式集群处理运行R脚本。这正确吗?谢谢alko! - Mike
"在Hadoop和Amazon EMR上使用R的MapReduce" - http://www.joyofdata.de/blog/mapreduce-r-hadoop-amazon-emr/ - Raffael
1个回答

2

@Mike,以下是你的3个问题的答案:

  • Running R on EMR: Yes you can. You can run R programs on EMR once you have installed R on the EMR instance. I assume that you would write MapReduce moules if you plan to use multi-instance cluster. If you program is just about a "plain" R program then you may have to just use one sizable instance. I would rather use an EC2 instance with R AMI (look for Louis Aslett).

  • Moving output files: Yes you can. It is possible to transfer your program output from EMR to S3 storage bucket of your choice. You will have to add a step calling S3DistCp command to move the files. An example from my project -

    --jar /home/hadoop/lib/emr-s3distcp-1.0.jar --args '--src,hdfs:///contents,--dest,s3://<bucket-name>/'
    
  • Reading spreadsheets: AFAIK, If you are able to do this on local installation of R, then you should also be able to do it on EMR. You have to ensure that the necessary packages/libraries are installed during the bootstrap process.

我可以在EMR实例上安装squeezy-cran和rmr2及其所有依赖项(如RCpp、reshap2、digest、RJSONIO、functional等)。但是我仍然无法将R程序作为步骤调用。我必须使用SSH会话并在shell提示符下运行R CMD命令。由于我在Windows上,所以putty.exe对我很有用。


2
R已经预装,对于S3不需要进一步的措施 - S3默认与EMR集成。 - Raffael

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接