MapReduce windows本地提交到yarn运行

1
2
3
4
5
6
7
8
9
10
Configuration configuration = new Configuration();
configuration.set("mapreduce.app-submission.cross-platform", "true");#跨平台提交
configuration.set("mapreduce.framework.name", "yarn");#运行在yarn上
configuration.set("yarn.resourcemanager.hostname", "bigdata131");#resourcemanager地址
//运行集群模式时,数据也必须从hdfs中存取
configuration.set("fs.defaultFS", "hdfs://bigdata131:9000/");
Job job = Job.getInstance(configuration);
job.setJar("D:\\hangyi\\bluewhaleinfo\\testmr\\target\\testmr-1.0-SNAPSHOT.jar");
#job.setJar的值为当前项目打包后jar包所在的路径,因为需要将jar包上传到hdfs上,
如果没有设置就会找不到我们的业务实现类(ClassNotFondException)