我使用AWS CLI和我启动群集使用下面的命令:AWS EMR - 上传文件到应用程序主
aws emr create-cluster --name "Config1" --release-label emr-5.0.0 --applications Name=Spark --use-default-role --ec2-attributes KeyName=ChiaveEMR --log-uri 's3://aws-logs-813591802533-us-west-2/elasticmapreduce/' --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m1.medium InstanceGroupType=CORE,InstanceCount=2,InstanceType=m1.medium
在那之后,我把一个文件分成主节点:
aws emr put --cluster-id j-NSGFSP57255P --key-pair-file "ChiaveEMR.pem" --src "./configS3.txt"
该文件位于/home/hadoop/configS3.txt。 后来我推出一个步:
aws emr add-steps --cluster-id ID_CLUSTER --region us-west-2 --steps Type=Spark,Name=SparkSubmit,Args=[--deploy-mode,cluster,--master,yarn,--executor-memory,1G,--class,Traccia2014,s3://tracceale/params/traccia-22-ottobre_2.11-1.0Ale.jar,/home/hadoop/configS3.txt,30,300,2,"s3a://tracceale/Tempi1"],ActionOnFailure=CONTINUE
但我得到这个错误:
17/02/23 14:49:51 ERROR ApplicationMaster: User class threw exception: java.io.FileNotFoundException: /home/hadoop/configS3.txt (No such file or directory)
java.io.FileNotFoundException: /home/hadoop/configS3.txt (No such file or directory)
可能是由于这样的事实,“configS3.txt”位于主,而不是奴隶。 我怎么能通过'configS3.txt'火花提交脚本?我也尝试过S3,但它不起作用。任何解决方案在此先感谢
我需要从S3或其他东西读取configS3.txt。我将路径“s3://tracceale/params/configS3.txt”传递给函数'fromFile',如下所示: for(line < - scala.io.Source.fromFile(logFile).getLines()) 这个函数不能读取S3路径,所以我需要找到另一个策略 –