Hadoop系统搭建好,并且能够运行wordcount和temperature后,就忙别的去了;最近又开始搞hadoop,结果发现原来的系统不能使了。首先出现了如下错误:
“java.io.IOException: The ownership/permissions on the staging directory hdfs://namenode/tmp/hadoop/mapred/staging/hadoop/.staging is not as expected. It is owned by hadoop and permissions are rwxrwxrwx, the directory must be owned by the submitter hadoop or by hadoop and permissions are rwx------..."
我怀疑是文件权限出了问题,因为前一段时间,我想通过eclipse直接调试程序,但是碰到了文件权限问题,后来我修改了文件权限(也有可能是前一段时间服务器掉电产生的不一致),记得好像就是这个文件夹,但最后还是没有试验成功;后来就放下了,暂定为全分布式模式不支持eclipse直接调试。现在,为了快速解决问题,我就把dfs重新格式化了一遍。
格式化之后,向dfs系统拷贝文件时出错,说是(回忆)应该向datanode拷贝一个block,但实际拷贝了零个。后来通过jps查看了各个机器,发现datanode节点datanode服务没有启动。
刚才看到这个帖子,试验成功:
http://www.cnblogs.com/wly603/archive/2012/04/20/2459837.html