I am doing as below
FileSystem fs = FileSystem.get(new URI("hdfs://IP:PORT"), context.getConfiguration());
path = new Path("/AAP");
fsOutStream = fs.create(path);
// read this file into InputStream
inputStream = new ByteArrayInputStream(value.getBytes());
IOUtils.copyBytes(inputStream, fsOutStream, context.getConfiguration()); //After this step a new folder AAP is available on HDFS
//Problem in below step
fs.copyToLocalFile(path, new Path("/xyz")); //After this step i am expecting that a folder local to DataNode with name "xyz" should be available but its not
注意:我只有一个DataNode,MapRed正在成功运行
有人可以建议可能是什么问题吗?
答案 0 :(得分:0)
要检查的事项:
您是否有权写入根目录?
尝试使用完整的网址:fs.copyToLocalFile(path, new Path("file:///home/hadoop/xyz"));