hadoop的java的APi使用的一些错误问题汇总

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/shursulei/article/details/79979803

错误一:

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>

猜你喜欢

转载自blog.csdn.net/shursulei/article/details/79979803