场景:错误java.lang.IllegalArgumentException:
Wrong
FS:
hdfs:/,
expected:
file:///
异常java.lang.IllegalArgumentException: Wrong FS: hdfs:/, expected: file:///
异常java.lang.IllegalArgumentException: Wrong FS: hdfs:/, expected: file:///
在hadoop-2.2.0版本中对hdfs进行简单的测试操作,代码如下所示
Configuration conf = new Configuration();
try {
FileSystem fs = FileSystem.get(conf);
Path f = new Path("hdfs:///dfs_operator.txt");
FSDataOutputStream os = fs.create(f, true);
int i = 0;
for (i = 0; i < 10; ++i)
os.writeChars("test");
os.close();
} catch (IOException e) {
e.printStackTrace();
}
执行报错信息如下:
Exception in thread "main" java.lang.reflect.InvocationTargetException