码迷,mamicode.com
首页 > 其他好文 > 详细

Hadoop3 No FileSystem for scheme "hdfs"

时间:2020-12-31 11:55:00      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:tcl   oop   class   site   rop   sch   core   loaded   XML   

Hadoop3 No FileSystem for scheme "hdfs"

异常信息:

org.apache.hadoop.fs.UnsupportedFileSystemException: No FileSystem for scheme "hdfs"
 at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:3372)
 at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:3392)
 at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:124)
 at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:3443)
 at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:3411)

异常FileSystem源码:

  public static Class<? extends FileSystem> getFileSystemClass(String scheme,
      Configuration conf) throws IOException {
    if (!FILE_SYSTEMS_LOADED) {
      loadFileSystems();
    }
    Class<? extends FileSystem> clazz = null;
    if (conf != null) {
      clazz = (Class<? extends FileSystem>) conf.getClass("fs." + scheme + ".impl", null);
    }
    if (clazz == null) {
      clazz = SERVICE_FILE_SYSTEMS.get(scheme);
    }
    if (clazz == null) {
      throw new IOException("No FileSystem for scheme: " + scheme);
    }
    return clazz;
  }

core-site.xml添加配置

<property>
	<name>fs.hdfs.impl</name>
    <value>org.apache.hadoop.hdfs.DistributedFileSystem</value>
</property>
<property>
	<name>fs.file.impl</name>
    <value>org.apache.hadoop.fs.LocalFileSystem</value>
</property>

Hadoop3 No FileSystem for scheme "hdfs"

标签:tcl   oop   class   site   rop   sch   core   loaded   XML   

原文地址:https://www.cnblogs.com/flowerbirds/p/14191874.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!