java.io.FileNotFoundException: File C:/tmp/hadoop-SYSTEM/mapred/local/taskTracker/jobcache/job_201007171612_0006/attempt_201007171612_0006_m_000001_0/work/tmp does not exist.at org.apache.hadoop.fs.RawLocalFileSystem.getFileStatus(RawLocalFileSystem.java:361)at org.apache.hadoop.fs.FilterFileSystem.getFileStatus(FilterFileSystem.java:245)at org.apache.hadoop.mapred.TaskRunner.setupWorkDir(TaskRunner.java:519)at org.apache.hadoop.mapred.Child.main(Child.java:155)
map过程中需要一些临时文件来存放map的结果。错误的原因在于找不到该临时文件。将mapred-site.xml配置文件中的配置mapred.child.tmp改为一个绝对路径:
<property>
<name>mapred.child.tmp</name>
<value>E:\Apache\Hadoop\Run\tmp</value>
<description> To set the value of tmp directory for map and reduce tasks.
If the value is an absolute path, it is directly assigned. Otherwise, it is
prepended with task's working directory. The java tasks are executed with
option -Djava.io.tmpdir='the absolute path of the tmp dir'. Pipes and
streaming are set with environment variable,
TMPDIR='the absolute path of the tmp dir'
</description>
</property>
另一种错误是reduce结果存放的文件已经存在:
org.apache.hadoop.mapred.FileAlreadyExistsException: Output directory hdfs://loc
alhost:8888/user/Administrator/output already exists
at org.apache.hadoop.mapred.FileOutputFormat.checkOutputSpecs(FileOutput
Format.java:111)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:7
72)
at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:730)
at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:1249)
at org.apache.hadoop.examples.Grep.run(Grep.java:84)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.hadoop.examples.Grep.main(Grep.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(Progra
mDriver.java:68)
at org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:139)
at org.apache.hadoop.examples.ExampleDriver.main(ExampleDriver.java:64)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.util.RunJar.main(RunJar.java:156)