?????????Distcp???????????
???????????? ???????[ 2013/11/4 11:11:21 ] ????????
?????????????????????£?
FSDataInputStream in = null;
FSDataOutputStream out = null;
try {
// open src file
in = srcstat.getPath().getFileSystem(job).open(srcstat.getPath());
reporter.incrCounter(Counter.BYTESEXPECTED?? srcstat.getLen());
// open tmp file
out = create(tmpfile?? reporter?? srcstat);
// copy file
for(int cbread; (cbread = in.read(buffer)) >= 0; ) {
out.write(buffer?? 0?? cbread);
cbcopied += cbread;
reporter.setStatus(
String.format("%.2f "?? cbcopied*100.0/srcstat.getLen())
+ absdst + " [ " +
StringUtils.humanReadableInt(cbcopied) + " / " +
StringUtils.humanReadableInt(srcstat.getLen()) + " ]");
}
} finally {
checkAndClose(in);
checkAndClose(out);
}
????Mapper????????DistCp???????????й??????????????????????????Щ?β??????????????Owner????????????Щ????????????????????
???????????
????DistCp??????????????????????????
????1.????????map task??“DFS Read: java.io.IOException: Could not obtain block”
????????????“_distcp_src_files”???????????????????????????hadoop-site.xml??????????dfs.replication=3?????_distcp_src_files??????????????????3?????map??????????????????_distcp_src_files???????????????datanode??????????????????map task???????????block??????????DistCp???“-i”??????????????????????????ò????????????????????????????????????????????????????????????????map????????????_distcp_src_files??????????????????????????????????????????????????????????????????????????????fix???????????????ó????????????????????????????????????????????????maptask??????????????Ч????????????????-m???????趨?????map??????????????????ganglia??bytes_in??bytes_out????????????
????2.Owner???????
????DistCp?????????????????????????????????DistCp?????????????????б?????????趨Owner?????????????????????κ???????????????????????????????????У?mapred????????????????????????????????????????????????????????е??Щ???????????????????-p????????????????????????????κ???????????Owner????????map task??????????????????????????????????????????????????????????????????distcp??jobtracker????????????kill??????????????????????Owner???????????????????????“nohup nice -n 0”???????????????????????
????3.??β????
????DistCp?з?map????????????????map????????????????????????????????????????п??????????????????????????????????????Щtask????tasktracker?????????????????????????????????????????????????????????????????Щ???????β???????InputSplit??????????????????????????????????????????????????????????????????????task????????????????????????к???????????
???????
????DistCp???????????????????????????????????????????????????????????????????????????μ?????????????Ч?????????????У????????ù???????????????????????????????????map???????????????????????Ч???????ù????????·???????????????????????????????????????????????????????????á????????????????????????distcp????????
???????
????DistCp??????????????????????????????Hadoop???????????????У?DistCp??????????????С????????????????????????????????MR????????????????????С?????????????????????????????????????????????????????????λ????Hadoop?????????????????DistCp??????????MR??????HDFS??????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11