MapReduce运行异常-- org.apache.hadoop.mapred.FileAlreadyExistsException

MapReduce运行异常--org.apache.hadoop.mapred.FileAlreadyExistsException

描述:输出文件已经存在

异常:

14/03/2623:00:52WARNmapred.JobClient:Nojobjarfileset.Userclassesmaynotbefound.SeeJobConf(Class)orJobConf#setJar(String).

14/03/2623:00:52INFOmapred.JobClient:Cleaningupthestagingareahdfs://xxx/opt/liveEpg/hadoop/hadoop_tmp/hadoop_hadoop/mapred/staging/allen/.staging/job_201312291735_0013

14/03/2623:00:52ERRORsecurity.UserGroupInformation:PriviledgedActionExceptionas:allencause:org.apache.hadoop.mapred.FileAlreadyExistsException:Outputdirectoryhdfs://xxx/mr/sort/sort_outalreadyexists

Exceptioninthread"main"org.apache.hadoop.mapred.FileAlreadyExistsException:Outputdirectoryhdfs://xxx/mr/sort/sort_outalreadyexists

atorg.apache.hadoop.mapreduce.lib.output.FileOutputFormat.checkOutputSpecs(FileOutputFormat.java:137)

atorg.apache.hadoop.mapred.JobClient$2.run(JobClient.java:887)

atorg.apache.hadoop.mapred.JobClient$2.run(JobClient.java:850)

atjava.security.AccessController.doPrivileged(NativeMethod)

atjavax.security.auth.Subject.doAs(Subject.java:396)

atorg.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121)

atorg.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:850)

atorg.apache.hadoop.mapreduce.Job.submit(Job.java:500)

atorg.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:530)

atsmiple.Sort.main(Sort.java:84)

解决办法:

将输出目录中相关文件删除,我一般直接将输出目录删了

命令:hadoopfs-rmr/mr/sort/sort_out

相关推荐