您的位置:首页 > 博客中心 > 互联网 >

MR程序本地调试,提交到集群运行

时间:2022-05-07 02:19

在本地调试,提交到集群上运行。

在本地程序中的Configuration中添加如下配置:

Configuration conf = new Configuration();
conf.set("fs.defaultFS", "hdfs://192.168.136.128:9000");

System.setProperty("HADOOP_USER_NAME","hadoop");

conf.set("mapreduce.job.jar", "D:\\qf_exam\\target\\qf_exam-1.0-SNAPSHOT.jar");         // 此处填写你的jar包地址

conf.set("mapreduce.framework.name", "yarn");
conf.set("yarn.resourcemanager.address", "http://hadoop03:8032");
conf.set("yarn.resourcemanager.scheduler.address","http://hadoop03:8030");
conf.set("mapreduce.app-submission.cross-platform", "true");//允许跨平台提交jar包

  这样就可以了。

  注意:要把程序给打成jar包,然后把jar包地址写道conf中。

  设置允许跨平台提交jar包

本类排行

今日推荐

热门手游