gpt4 book ai didi

hadoop - copyToLocal没有将本地文件复制到DataNode

转载 作者:行者123 更新时间:2023-12-02 21:51:13 25 4
gpt4 key购买 nike

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运行成功

有人可以提出建议,因为可能是问题所在吗?

最佳答案

检查事项:

您是否有权写入根目录?

尝试使用完整的URL:fs.copyToLocalFile(path, new Path("file:///home/hadoop/xyz"));

关于hadoop - copyToLocal没有将本地文件复制到DataNode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20743095/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com