在eclipse下运行hadoop程序时遇到报错:
程序是创建了一个文件,
代码如下:
FileSystem fs = new FileSystem.get(conf);
Path path = new Path("hdfs://test.txt");
FSDataOutputStream.create(path);
报错如下:
java.lang.IllegalArgumentException: Wrong FS: hdfs:/
, expected: file:///
后来经过调查发下,hadoop需要把集群上的core-site.xml和hdfs-site.xml放到当前工程下。
然后运行即可。
本文解决了一个在Eclipse中运行Hadoop程序时出现的错误:java.lang.IllegalArgumentException:WrongFS:hdfs:/ 需要将核心配置文件core-site.xml和hdfs-site.xml放入工程中。

被折叠的 条评论
为什么被折叠?



