用eclipse开发hadoop时报
1.org.apache.hadoop.security.AccessControlException: Permission denied: user=hadoop, access=READ_EXECUTE, inode="system":hadoop:supergroup:rwx-wx-wx错误,解决方法:
在hdfs-site.xml 中取消权限校验,即加入以下配置:
<property>
<name>dfs.permissions</name>
<value>false</value>
<description>
If "true", enable permission checking in HDFS.
If "false", permission checking is turned off,
but all other behavior is unchanged.
Switching from one parameter value to the other does not change the mode,
owner or group of files or directories.
</description>
</property>
修改完貌似要重启下hadoop的进程才能生效。
2.查看hadoop 自带的examples 中的 wordCount.java 时
org.apache.hadoop.mapred.InvalidInputException: Input path does not exist: hdfs://localhost:9000/tmp/wordcout/wordcount.txt
是因为本地的wordcount.txt目录并没有上传到HDFS上
使用命令: hadoop fs -copyFormLocal {本地文件} /tmp/wordcount/wordcount.txt 不要忘记文件格式 .txt