Spark No FileSystem for scheme file 解决方法
在给代码带包成jar后,放到环境中运行出现如下错误:
Exception in thread "main" java.io.IOException: No FileSystem for scheme: file
at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2644)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2651)
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:92)
at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2687)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2669)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:371)
at org.apache.hadoop.fs.Path.getFileSystem(Path.java:295)
at org.apache.spark.sql.catalyst.catalog.SessionCatalog.makeQualifiedPath(SessionCatalog.scala:115)
at org.apache.spark.sql.catalyst.catalog.SessionCatalog.createDatabase(SessionCatalog.scala:145)
at org.apache.spark.sql.catalyst.catalog.SessionCatalog.<init>(SessionCatalog.scala:89)
at org.apache.spark.sql.internal.SessionState.catalog$lzycompute(SessionState.scala:95)
at org.apache.spark.sql.internal.SessionState.catalog(SessionState.scala:95)
at org.apache.spark.sql.internal.SessionState$$anon$1.<init>(SessionState.scala:112)
at org.apache.spark.sql.internal.SessionState.analyzer$lzycompute(SessionState.scala:112)
at org.apache.spark.sql.internal.SessionState.analyzer(SessionState.scala:111)
at org.apache.spark.sql.execution.QueryExecution.assertAnalyzed(QueryExecution.scala:49)
at org.apache.spark.sql.Dataset$.ofRows(Dataset.scala:64)
at org.apache.spark.sql.SparkSession.baseRelationToDataFrame(SparkSession.scala:382)
at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:143)
at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:122)
at org.elasticsearch.spark.sql.EsSparkSQL$.esDF(EsSparkSQL.scala:52)
at org.elasticsearch.spark.sql.EsSparkSQL$.esDF(EsSparkSQL.scala:66)
at org.elasticsearch.spark.sql.package$SparkSessionFunctions.esDF(package.scala:58)
at SQLAttack$.getDayDataByES(SQLAttack.scala:51)
at SQLAttack$.main(SQLAttack.scala:25)
at SQLAttack.main(SQLAttack.scala)
这是因为 HDFS 的配置文件没写好,更改方式如下:
找到自己项目保存库的位置,依次点击:
File -> Settings -> Build,Execution,Deployment -> Build Tools -> Maven -> Local repository
这里的 Local repository 就是项目保存库的位置。在这里面依次打开文件位置:
\repository\org\apache\hadoop\hadoop-common\2.7.2\
用 rar 打开 hadoop-common-2.7.2.jar ,把里面的 core-default.xml 下载到本地,打开添加更改,在 <!--- global properties --> 添加如下字段:
<!--- global properties -->
<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-default.xml 重新放入 hadoop-common-2.7.2.jar 中,再次打包就可以运行了
Spark No FileSystem for scheme file 解决方法的更多相关文章
- vss error reading from file 解决方法
vss error reading from file 解决方法 1 若服务器中存在 vss/data/backup目录,请将该目录删掉2 运行cmd cd.. cd C:\Program Files ...
- centos vsftpd 553 Could not create file解决方法
centos vsftpd 553 Could not create file解决方法 问题由于selinux引起的,问题解决办法: www.2cto.com 输入:getsebool - ...
- MapReduce 踩坑 - hadoop No FileSystem for scheme: file/hdfs
一.场景 hadoop-3.0.2 + hbase-2.0.0 一个mapreduce任务,在IDEA下本地提交到hadoop集群可以正常运行. 现在需要将IDEA本地项目通过maven打成jar包, ...
- eclipse启动出现“An Error has Occurred. See the log file”解决方法
最近在启动eclipse时出现了“An Error has Occurred. See the log file”的错误,点击确定后也不能启动eclipse.查看log文件,出现类似: java.la ...
- Linux下is not in the sudoers file解决方法
最近在学习linux,在某个用户(xxx)下使用sudo的时候,提示以下错误:xxx is not in the sudoers file. This incident will be reporte ...
- Linux中“is not in the sudoers file”解决方法
当在终端执行sudo命令时,系统提示"hadoop is not in the sudoers file": 其实就是没有权限进行sudo,解决方法如下(这里假设用户名是cuser ...
- 【原创】Unable to read TLD "META-INF/c.tld" from JAR file 解决方法
type Exception report message description The server encountered an internal error () that prevented ...
- kafka broker Leader -1引起spark Streaming不能消费的故障解决方法
一.问题描述:Kafka生产集群中有一台机器cdh-003由于物理故障原因挂掉了,并且系统起不来了,使得线上的spark Streaming实时任务不能正常消费,重启实时任务都不行.查看kafka t ...
- 关于Ubuntu下is not in the sudoers file解决方法
当我在postgres用户下去执行sudo vim demo.sql需要用管理员权限运行时,并且输入本用户的密码,但是输入之后提示如下: postgers is not in the sudoers ...
随机推荐
- 版本控制工具svn的安装与简单使用
版本控制工具多用于多人协作开发项目中,这不同于个人开发项目,想把自己代码怎样放置都可以,而且删除了代码很难查找. 版本控制工具类似于个人处理钱的过程,放于自己口袋管理类似于个人开发情形,如果自己钱丢了 ...
- html <input type="text" />加上readonly后在各种浏览器的差异。
<html> <body> <p>Name:<input type="text" name="email" /> ...
- VS2012打开项目 提示Asp.net4.5未在web服务器上注册
在用vs2012代开项目时,没回都显示Asp.net4.5未在web服务器上注册,最后是由于没有下载一个补丁的原因,只需要下载安装补丁 VS11-KB3002339.exe ,下载地址:https:/ ...
- 从Android源码的角度分析Binder机制
欢迎访问我的个人博客,原文链接:http://wensibo.top/2017/07/03/Binder/ ,未经允许不得转载! 前言 大家好,好久不见,距离上篇文章已经有35天之久了,因为身体不舒服 ...
- XML 新手入门基础知识
XML 是可扩展标记语言(Extensible Markup Language)的缩写,其中的 标记(markup)是关键部分.您可以创建内容,然后使用限定标记标记它,从而使每个单词.短语或块成为可识 ...
- Educational Codeforces Round 22.B 暴力
B. The Golden Age time limit per test 1 second memory limit per test 256 megabytes input standard in ...
- VB6之断点续传
闲来无事,研究了下HTTP的断点续传,用VB6写了小Demo. 关于HTTP-Range细节可参考: http://www.w3.org/Protocols/rfc2616/rfc2616.html ...
- VB6之ICMP实现ping功能
代码备忘 'code by lichmama from cnblogs.com Private Type IPAddr ip1 As Byte ip2 As Byte ip3 As Byte ip4 ...
- SerializableObj
package JBJADV003; import java.io.*; public class SerializableObj { /** * @param args * @throws IOEx ...
- usaco training 4.2.4 Cowcycles 题解
Cowcycles题解 Originally by Don Gillies [International readers should note that some words are puns on ...