Hadoop-MapReduce任务三种运行开发模式

1、local模式

数据在本地,代码也在本地,使用本机的电脑的资源运行我们的MR

输入和输出路径指的都是本地路径,运行时耗费的资源也是本地资源。

2、local模式2

数据在hdfs上,代码在本地,使用本机的电脑的资源运行我们的MR

复制代码
        System.setProperty("HADOOP_USER_NAME","root");    
        Configuration configuration = new Configuration();
        
        configuration.set("fs.defaultFS","hdfs://192.168.32.128:9820");
        // 使用本地的资源(CPU,内存等), 也可以使用yarn平台跑任务
        configuration.set("mapreduce.framework.name","local");

这个里面的输入和输出路径指的是hdfs上的路径。

3、Yarn模式

数据在hdfs上,代码 跑 在yarn上。

复制代码
        System.setProperty("HADOOP_USER_NAME","root");    
        Configuration configuration = new Configuration();
        
        configuration.set("fs.defaultFS","hdfs://192.168.32.128:9820");
        
        configuration.set("mapreduce.framework.name","yarn");

        // 跨平台任务提交打开
        configuration.set("mapreduce.app-submission.cross-platform", "true");	
相关推荐
大大大大晴天2 天前
Hudi Metadata Table 与 Hive Sync (HMS)怎么选?
大数据
手可摘星辰7772 天前
一次线上FlinkCDC异常排查复盘
大数据·flink
大大大大晴天2 天前
Hudi技术内幕:Metadata Table原理与实践
大数据
大大大大晴天3 天前
Hudi技术内幕:深入解析Index索引机制
大数据
阿里云大数据AI技术3 天前
Flink Forward Asia 2026 深圳启幕:Agentic Streaming for AI,开启实时智能新范式
大数据·flink
SelectDB4 天前
阶跃星辰基于 SelectDB 构建 PB 级 Agent 可观测平台
大数据·数据库·aigc
大大大大晴天7 天前
Hudi技术内幕:RecordPayload到RecordMerger
大数据
SelectDB8 天前
秒级弹性、最高降本 70%:SelectDB Serverless 如何重塑云数仓资源效率
大数据·后端·云原生
WhoAmI8 天前
MapReduce框架原理解析一:InputFormat
大数据·hadoop
WhoAmI8 天前
MapReduce框架原理解析三:OutputFormat
大数据·hadoop