0

我正在尝试每天将数据从一个集群复制到另一个集群。搜索了很多,但每个人都建议用 args 调用 DistCp 的 main 函数。我正在为此编写Java代码。但它不起作用,我也没有任何错误。命令行上的 distcp 工作正常。这里需要做什么?

public static void customDiscp(String source, String destination) throws Exception {
  String[] args = new String[4];
  args[0] = "-log";
  args[1] = "/projects/logs";
  args[2] = source;
  args[3] = destination;
  DistCp.main(args);
}
4

1 回答 1

0

要在 Java 中编写 map reduce 作业,您必须使用 map reduce api。参考本教程编写一个 mr 作业

https://hadoop.apache.org/docs/r1.2.1/mapred_tutorial.html

于 2016-04-04T15:58:59.980 回答