将 java hadoop 作业迁移到 dataproc 的最佳方法是什么
What is the best way to migrate java hadoop jobs to dataproc
我正在关注 the example from google。
在我的旧代码中,我的作业提交如下:
Configuration conf = HBaseConfiguration.create();
Job job = Job.getInstance(conf, "word count");
job.setJobName("");
job.setJarByClass(getClass()); // class that contains mapper and reducer
job.setMapSpeculativeExecution(false);
job.setCombinerClass(<JobCombiner>.class);
job.setReducerClass(<JobReducer>.class);
job.setReduceSpeculativeExecution(false);
// some additional configs
job.submit();
如何将此作业迁移到 dataproc?
我试着按照这个答案 -
我使用 HaoopJob 而不是 SparkJob。但这里的主要问题是我们需要提交 jar 和主要 class 文件。有什么方法可以简单地迁移现有作业 class 和 运行 dataproc 中的作业?
鉴于该代码,您应该能够直接运行 mapreduce jar。
Hadoop 作业是根据存在于每个节点上的 xml 配置文件为其集群配置的,通常不在代码本身中
我正在关注 the example from google。
在我的旧代码中,我的作业提交如下:
Configuration conf = HBaseConfiguration.create();
Job job = Job.getInstance(conf, "word count");
job.setJobName("");
job.setJarByClass(getClass()); // class that contains mapper and reducer
job.setMapSpeculativeExecution(false);
job.setCombinerClass(<JobCombiner>.class);
job.setReducerClass(<JobReducer>.class);
job.setReduceSpeculativeExecution(false);
// some additional configs
job.submit();
如何将此作业迁移到 dataproc?
我试着按照这个答案 -
鉴于该代码,您应该能够直接运行 mapreduce jar。
Hadoop 作业是根据存在于每个节点上的 xml 配置文件为其集群配置的,通常不在代码本身中