我使用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路徑,所以我需要找到另一個策略 –