0

我刚刚在一个小型集群上成功安装了 Hadoop。现在我正在尝试运行 wordcount 示例,但出现此错误:

****hdfs://localhost:54310/user/myname/test11
12/04/24 13:26:45 INFO input.FileInputFormat: Total input paths to process : 1
12/04/24 13:26:45 INFO mapred.JobClient: Running job: job_201204241257_0003
12/04/24 13:26:46 INFO mapred.JobClient:  map 0% reduce 0%
12/04/24 13:26:50 INFO mapred.JobClient: Task Id : attempt_201204241257_0003_m_000002_0, Status : FAILED
Error initializing attempt_201204241257_0003_m_000002_0:
java.io.IOException: Exception reading file:/tmp/mapred/local/ttprivate/taskTracker/myname/jobcache/job_201204241257_0003/jobToken
    at org.apache.hadoop.security.Credentials.readTokenStorageFile(Credentials.java:135)
    at org.apache.hadoop.mapreduce.security.TokenCache.loadTokens(TokenCache.java:165)
    at org.apache.hadoop.mapred.TaskTracker.initializeJob(TaskTracker.java:1179)
    at org.apache.hadoop.mapred.TaskTracker.localizeJob(TaskTracker.java:1116)
    at org.apache.hadoop.mapred.TaskTracker$5.run(TaskTracker.java:2404)
    at java.lang.Thread.run(Thread.java:722)
Caused by: java.io.FileNotFoundException: File file:/tmp/mapred/local/ttprivate/taskTracker/myname/jobcache/job_201204241257_0003/jobToken does not exist.
    at org.apache.hadoop.fs.RawLocalFileSystem.getFileStatus(RawLocalFileSystem.java:397)
    at org.apache.hadoop.fs.FilterFileSystem.getFileStatus(FilterFileSystem.java:251)
    at org.apache.hadoop.fs.ChecksumFileSystem$ChecksumFSInputChecker.<init>(ChecksumFileSystem.java:125)
    at org.apache.hadoop.fs.ChecksumFileSystem.open(ChecksumFileSystem.java:283)
    at org.apache.hadoop.fs.FileSystem.open(FileSystem.java:427)
    at org.apache.hadoop.security.Credentials.readTokenStorageFile(Credentials.java:129)
    ... 5 more

有什么帮助吗?

4

2 回答 2

2

我刚刚解决了同样的错误——在我的 Hadoop 目录上递归设置权限没有帮助。按照Mohyt的建议我修改core-site.xml(在 hadoop/conf/ 目录中)以删除我指定临时目录的位置(hadoop.tmp.dir在 XML 中)。允许 Hadoop 创建自己的临时目录后,我运行无错误。

于 2012-06-14T14:23:49.633 回答
0

最好创建自己的临时目录。

<configuration>
 <property>
 <name>hadoop.tmp.dir</name>
 <value>/home/unmesha/mytmpfolder/tmp</value>
 <description>A base for other temporary directories.</description>
 </property>
.....

并给予许可

unmesha@unmesha-virtual-machine:~$chmod 750 /mytmpfolder/tmp

检查core-site.xml 配置

于 2014-04-30T20:57:37.153 回答