错误一:
Exception in thread "main" java.io.IOException: No FileSystem for scheme: hdfs
原因是:缺少hadoop-hdfs的依赖包
Exception in thread "main" java.io.IOException: No FileSystem for scheme: hdfs
at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2676)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2690)
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:94)
at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2733)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2715)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:382)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:181)
错误二:
Permission denied: user=administrator, access=WRITE, inode="/":root:supergroup:drwxr-xr-x
这里需要修改配置文件,hadoop/conf/hdfs-site.xml(cdh版本在etc/hadoop/conf)中加入
<property>
<name>dfs.permissions</name>
<value>false</value>
</property>