mapreduce with hadoop,“输出文件目录已经存在”

flvlnr44  于 2021-06-01  发布在  Hadoop
关注(0)|答案(1)|浏览(468)

我正在尝试使用amazons emr服务上托管的集群。我尝试使用wordcount.jar文件运行wordcount示例,并使用随机输出文件夹input1.txt。我的输入语法是wordcount argv[1]argv[2]。input1.txt的路径是argv[1],argv[2]是到输出的路径。我知道如果多次尝试使用同一个输出目录,hadoop会很生气。为了绝对肯定你们,我有台词->

FileInputFormat.addInputPath(job, new Path(args[1]));
FileOutputFormat.setOutputPath(job, new Path(args[2]));

不管我放在哪个输出目录,这都是我的结果,

Exception in thread "main" org.apache.hadoop.mapred.FileAlreadyExistsException: Output directory https://s3.us-east-2.amazonaws.com/mydirectory/gabagooba already exists
at org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.checkOutputSpecs(FileOutputFormat.java:146)
at org.apache.hadoop.mapreduce.JobSubmitter.checkSpecs(JobSubmitter.java:268)
at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:141)
at org.apache.hadoop.mapreduce.Job$11.run(Job.java:1341)
at org.apache.hadoop.mapreduce.Job$11.run(Job.java:1338)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1844)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:1338)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1359)
at WordCountDemo.WordCount.main(WordCount.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.hadoop.util.RunJar.run(RunJar.java:239)
at org.apache.hadoop.util.RunJar.main(RunJar.java:153)

我的输出目录应该存储在s3存储中,但是当我去那里时,没有输出。任何帮助都能使我摆脱这种习惯。

i7uq4tfw

i7uq4tfw1#

可以将输出位置指定为s3而不是https吗。
示例:s3://yourbucket/output
裁判:https://docs.aws.amazon.com/emr/latest/managementguide/emr-plan-output.html

相关问题