在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放到当前工程下。
然后运行即可。