标签:download system new rup row entry copyto and file
FileSystem init() throws URISyntaxException, IOException, InterruptedException {
Configuration conf=new Configuration();
conf.set("fs.defaultFS","hdfs://wangchaoqi01:9000");
return FileSystem.get(new URI("hdfs://wangchaoqi01:9000"),conf,"root");
}
void download() throws InterruptedException, IOException, URISyntaxException {
FileSystem fs=this.init();
fs.copyToLocalFile(new Path("hdfs://wangchaoqi01:9000/1.txt"),
new Path("F:/"));
}
解决:
fs.copyToLocalFile(false,hdfs_path, local_path,true);
第一个false参数表示不删除源文件,第4个true参数表示使用本地原文件系统,因为这个Demo程序是在Windows系统下运行的。
copyToLocalFile报错:(null) entry in command string: null chmod 0644
标签:download system new rup row entry copyto and file
原文地址:https://www.cnblogs.com/wangchaoqi/p/11929126.html