Windows下 haoop下运行程序时出现错误:Hadoop HDFS Wrong FS: hdfs:/ expected file:///
来源:互联网 发布:阿里云logo矢量图下载 编辑:程序博客网 时间:2024/06/09 15:38
Windows下 haoop下运行程序时出现错误:Hadoop HDFS Wrong FS: hdfs:/ expected file:///
贡献博客一篇:点击打开链接
很多坑,暂且记录
先看解决办法:
无非是两种方式:
1. 在 eclipse 工程 src 问价夹下加入三个文件
1)hdfs-site.xml
2)core-site.xml
3)mapred-site.xml
上面三个文件,都是你linux环境安装hadoop 的配置的xml 文件
如下图:
2. 其次 解决方法:
conf.set("mapred.jop.tracker", "hdfs://192.168.121.167:8030"); conf.set("fs.default.name", "hdfs://192.168.121.167:8020");下面这一行是解决hdfs.shell api 使用问题: 这个也是一个坑,暂且记录
System.setProperty("hadoop.home.dir", "D:\\hadoop-2.7.3");
看源码:
public boolean mkdir(String filePath) throws Exception { Configuration conf = new Configuration(); // 远程会出现问题 Windows测试需要如下配置 conf.set("mapred.jop.tracker", "hdfs://192.168.121.167:8030"); conf.set("fs.default.name", "hdfs://192.168.121.167:8020"); System.setProperty("hadoop.home.dir", "D:\\hadoop-2.7.3"); boolean result = false; FileSystem fs = null; //java.lang.IllegalArgumentException: Wrong FS: hdfs://192.168.121.167:8020/user/wangxiaoming/input/cpcn/892/1200/20170425/wangxiaoming, expected: file:/// try { fs = FileSystem.get(conf); Path srcPath = new Path(filePath); result = fs.mkdirs(srcPath); }catch(IllegalArgumentException e){ return false; }catch (Exception e) { throw e; }finally{ fs.close(); } return result; }
0 0
- Windows下 haoop下运行程序时出现错误:Hadoop HDFS Wrong FS: hdfs:/ expected file:///
- Hadoop HDFS Wrong FS: hdfs:/ expected file:///
- hadoop运行报错Wrong FS: hdfs:/, expected: file:///
- Wrong FS: hdfs:/ expected: file:///
- Wrong FS: hdfs:, expected:file:///
- Wrong FS: hdfs://******, expected: file:///
- Wrong FS: hdfs expected: file:
- Hadoop使用java查询HDFS 错误:Wrong FS: hdfs://localhost:9000/user/hadoop, expected: file:///
- Wrong FS: hdfs://localhost:9000/home/hadoop/hadoop, expected: file:///
- Hadoop Problem : Wrong FS: hdfs://localhost:9000/output, expected: file:///
- hadoop程序问题:java.lang.IllegalArgumentException: Wrong FS: hdfs://.... expected file:///
- hadoop程序问题:java.lang.IllegalArgumentException: Wrong FS: hdfs:/ expected file:///
- hadoop程序抛出异常:java.lang.IllegalArgumentException: Wrong FS: hdfs:/ expected file:///
- hadoop程序问题:java.lang.IllegalArgumentException: Wrong FS: hdfs:/ expected file:///
- hadoop程序问题:java.lang.IllegalArgumentException: Wrong FS: hdfs:/ expected file:///
- HDFS 的Java操作“ Wrong FS: hdfs://xxx, expected: file:///”
- Hadoop问题记录:Wrong FS: hdfs://hp5-249:9000/, expected: file:///
- Python通过thrift访问hadoop:报错java.lang.IllegalArgumentException: Wrong FS: hdfs:/ expected file:///
- Android -- Wifi的save()操作
- (网络流)最大流复习
- 图片自适应父元素大小,并左右上下居中的css方法
- php中echo js中alert中文乱码问题的解决方法
- java.beans.Introspector
- Windows下 haoop下运行程序时出现错误:Hadoop HDFS Wrong FS: hdfs:/ expected file:///
- jsp 统计有几个2000年到2014年有几个闰年
- 551. Student Attendance Record I
- ZooKeeper 下载安装
- struts2标签库----数据标签详解
- Centos 6.5 Install SCP
- oracle 监控索引使用情况
- Android -- Wifi的forget()操作
- Selenium2.0之WebDriver学习总结(2)