No FileSystem for scheme: file 解决方法

本文详细介绍了在使用Eclipse打包的jar包部署到服务器时,遇到的Hadoop配置问题及其解决方案。通过在core-site.xml中添加关键配置项,可以避免因文件系统配置缺失导致的执行失败。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

程序打成jar包后,放到服务器上去执行,程序能够按预期去正确执行,但看到如下错误还是很不爽:

2014-08-13 17:16:49 [WARN]-[main]-[org.apache.hadoop.hbase.util.DynamicClassLoader] Failed to identify the fs of dir /tmp/hbase-ecm2/hbase/lib, ignored
java.io.IOException: No FileSystem for scheme: file
at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2385) ~[ecm.jar:na]
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2392) ~[ecm.jar:na]
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:89) ~[ecm.jar:na]
at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2431) ~[ecm.jar:na]
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2413) ~[ecm.jar:na]
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:368) ~[ecm.jar:na]


【问题分析:】
eclipse打包完成后,jar包中core-site.xml配置文件中不存在以下两个配置项。

<property>
<name>fs.hdfs.impl</name>
<value>org.apache.hadoop.hdfs.DistributedFileSystem</value>
<description>The FileSystem for hdfs: uris.</description>
</property>
<property>
<name>fs.file.impl</name>
<value>org.apache.hadoop.fs.LocalFileSystem</value>
<description>The FileSystem for hdfs: uris.</description>
</property>

只要将上面两个配置加到core-site.xml中,然后替换jar包中的xml,重新扔到服务器上,就可以成功运行了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值