今天为了学习Mahout,部署了一个单机模式的Hadoop-1.2.1
过程中logs/hadoop-casliyang-namenode-singlehadoop.log明显报错如下:
2014-04-15 15:44:03,124 INFO org.apache.hadoop.ipc.Server: IPC Server handler 2 on 9000, call addBlock(/tmp/hadoop-casliyang/mapred/system/jobtracker.info, DFSClient_NONMAPREDUCE_1400027111_1, null) from 192.168.0.80:48613: error: java.io.IOException: File /tmp/hadoop-casliyang/mapred/system/jobtracker.info could only be replicated to 0 nodes, instead of 1
网上各种招都不好使,网上总结得比较全的文章是:http://blog.csdn.net/blueheart20/article/details/21100423
然后发现在
logs/hadoop-casliyang-datanode-singlehadoop.log中没有报错,但是有这样一条警告:
2014-04-15 14:48:22,871 WARN org.apache.hadoop.hdfs.server.datanode.DataNode: Invalid directory in dfs.data.dir: Incorrect permission for /home/casliyang/hadoop/hadoop_data1, expected: rwxr-xr-x, while actual: rwxrwxr-x
把hadoop_data1的权限修改为rwxr-xr-x即可正常启动。
经验总结:以后遇到错误时,不单单在log中搜索关键字error,还要搜索warn!