[初学hadoop]错误信息:hdfs://192.168.0.16:9000/report.bak, expected: file:///
2015-03-24 10:47
423 查看
在本地运行hadoop Map/Reduce程序时,在涉及到hdfs文件操作的时候,往往会出现上面提到的错误,例如,下面这段代码:
1 Path clear_path = new Path(args[1]);
2 FileSystem fs = FileSystem.get(conf);
3 fs.delete(clear_path);
通过试验发现,在分布式hadoop集群上运行这段代码是不会出现错误的,然而在本机伪分布式环境下运行这段代码就会出现前面提到的错误信息。有两种方法来解决这个问题。
解决方法1:
将上述代码稍作修改,利用clear_path来获取FileSystem,改为如下代码片段:
Path clear_path = new Path(args[1]);
FileSystem fs = clear_path.getFileSystem(conf);
fs.delete(clear_path);
这样运行起来就不会报错。
解决方案2:
更为彻底的解决方法需要将hadoop目录中的conf文件夹中的hdfs-site.xml与core-site.xml复制到你的项目的目录之下,这样就不会再报这种错误
1 Path clear_path = new Path(args[1]);
2 FileSystem fs = FileSystem.get(conf);
3 fs.delete(clear_path);
通过试验发现,在分布式hadoop集群上运行这段代码是不会出现错误的,然而在本机伪分布式环境下运行这段代码就会出现前面提到的错误信息。有两种方法来解决这个问题。
解决方法1:
将上述代码稍作修改,利用clear_path来获取FileSystem,改为如下代码片段:
Path clear_path = new Path(args[1]);
FileSystem fs = clear_path.getFileSystem(conf);
fs.delete(clear_path);
这样运行起来就不会报错。
解决方案2:
更为彻底的解决方法需要将hadoop目录中的conf文件夹中的hdfs-site.xml与core-site.xml复制到你的项目的目录之下,这样就不会再报这种错误
相关文章推荐
- [初学hadoop]错误信息:Wrong FS: hdfs://localhost:9000/user/... expected:&nb
- Hadoop使用java查询HDFS 错误:Wrong FS: hdfs://localhost:9000/user/hadoop, expected: file:///
- Hadoop Problem : Wrong FS: hdfs://localhost:9000/output, expected: file:///
- Wrong FS: hdfs://localhost:9000/home/hadoop/hadoop, expected: file:///
- hadoop异常: Wrong FS: hdfs://192.168.1.xx:9000/output, expected: file:///
- Hadoop问题记录:Wrong FS: hdfs://hp5-249:9000/, expected: file:///
- hadoop异常: Wrong FS: hdfs://192.168.1.xx:9000/output, expected: file:///
- Wrong FS: hdfs://hadoop20:9000/word.txt, expected: file:///---异常解决方案
- hadoop异常: Wrong FS: hdfs://192.168.1.xx:9000/output, expected: file:///
- hadoop dfs 保错.IllegalArgumentException: Wrong FS: hdfs://XXX:9000, expected: file:///
- Windows下 haoop下运行程序时出现错误:Hadoop HDFS Wrong FS: hdfs:/ expected file:///
- Wrong FS: hdfs://hadoop20:9000/word.txt, expected: file:///
- 润乾V5部署异常信息:no report config file!错误排除步骤
- hadoop程序抛出异常:java.lang.IllegalArgumentException: Wrong FS: hdfs:/ expected file:///
- hadoop程序问题:java.lang.IllegalArgumentException: Wrong FS: hdfs:/ expected file:///
- hadoop多节点集群搭建过程中错误:No such file or directoryhdfs,logs提示出现出现^M的解决办法
- java.lang.IllegalArgumentException: Wrong FS: hdfs://localhost:54310/user/Hadoop/b, expected: file:/
- java.lang.IllegalArgumentException: Wrong FS: hdfs://localhost:9000/out, expected: file:///
- hadoop程序问题:java.lang.IllegalArgumentException: Wrong FS: hdfs://.... expected file:///
- Wrong FS: hdfs://localhost:9000/input, expected: file:///