zoukankan      html  css  js  c++  java
  • hadoop1 & hadoop2 fair-schduler 配置和使用

    hadoop1

    • 配置 mapred-site.xml,增加如下内容
     <property>
            <name>mapred.jobtracker.taskScheduler</name>
            <value>org.apache.hadoop.mapred.FairScheduler</value>
        </property>
        <property>
            <name>mapred.fairscheduler.allocation.file</name>
            <value>/etc/hadoop/conf/pools.xml</value>
        </property>
    • 配置 pools.xml,增加如下内容
    
    <queue name="default”>
      <minResources>1024 mb,1vcores</minResources>
      <maxResources>61440 mb,20vcores</maxResources>
      <maxRunningApps>10</maxRunningApps>
      <weight>2.0</weight>
      <schedulingPolicy>fair</schedulingPolicy>
    </queue>
    
    <queue name=“hadoop”>
      <minResources>1024 mb,10vcores</minResources>
      <maxResources>3072000 mb,960vcores</maxResources>
      <maxRunningApps>60</maxRunningApps>
      <weight>5.0</weight>
      <schedulingPolicy>fair</schedulingPolicy>
      <aclSubmitApps>hadoop,yarn,spark</aclSubmitApps>
    </queue>
    
    <queue name="spark">
      <minResources>1024 mb,10vcores</minResources>
      <maxResources>61440 mb,20vcores</maxResources>
      <maxRunningApps>10</maxRunningApps>
      <weight>4.0</weight>
      <schedulingPolicy>fair</schedulingPolicy>
    <aclSubmitApps>yarn,spark</aclSubmitApps>
    </queue>
    
    <userMaxAppsDefault>20</userMaxAppsDefault>
    
    • 提交作业指定队列方式
     -Dmapred.job.queue.name=hadoop

    hadoop2

    • 配置 yarn-site.xml,增加如下内容
    <property>
      <name>yarn.resourcemanager.scheduler.class</name>
                     <value>org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler</value>
    </property>
    
    <property>
       <name>yarn.scheduler.fair.allocation.file</name>
       <value>/home/cluster/conf/hadoop/fair-scheduler.xml</value>
    </property>
    
    <property>  
      <name>yarn.scheduler.fair.user-as-default-queue</name>
      //如果希望以用户名作为队列,可以将该属性配置为true,默认为true,所以如果不想以用户名为队列的,必须显式的设置成false  
      <value>false</value>  
    </property> 
    • 配置 fair-scheduler.xml,增加如下内容
    <queue name="default”>
      <minResources>1024 mb,1vcores</minResources>
      <maxResources>61440 mb,20vcores</maxResources>
      <maxRunningApps>10</maxRunningApps>
      <weight>2.0</weight>
      <schedulingPolicy>fair</schedulingPolicy>
    </queue>
    
    <queue name=“hadoop”>
      <minResources>1024 mb,10vcores</minResources>
      <maxResources>3072000 mb,960vcores</maxResources>
      <maxRunningApps>60</maxRunningApps>
      <weight>5.0</weight>
      <schedulingPolicy>fair</schedulingPolicy>
      <aclSubmitApps>hadoop,yarn,spark</aclSubmitApps>
    </queue>
    
    <queue name="spark">
      <minResources>1024 mb,10vcores</minResources>
      <maxResources>61440 mb,20vcores</maxResources>
      <maxRunningApps>10</maxRunningApps>
      <weight>4.0</weight>
      <schedulingPolicy>fair</schedulingPolicy>
    <aclSubmitApps>yarn,spark</aclSubmitApps>
    </queue>
    
    <userMaxAppsDefault>20</userMaxAppsDefault>
    
    • 提交作业指定队列方式
     -Dmapreduce.job.queuename=root.hadoop

    spark

    • 提交作业指定队列方式
     --queue=root.spark

    版权声明:本文为博主原创文章,未经博主允许不得转载。

  • 相关阅读:
    JN_0026:FTP连接站点 规避防火墙
    JS_0002:js读取外部json文件
    JQPlug0002:layer Zindex不断增加的问题 弹窗一直置顶
    JQPlug0001:layer父子页面通信,常用打开模版
    Web_0010:Html打包EXE方法
    Web_0009:win系统下注册自己的协议,用于web项目启动本地程序
    ZAB 和 Paxos 算法的联系与区别?
    保证缓存与数据库双写时的数据一致性
    解决 Redis 的并发竞争 Key 问题
    缓存雪崩和缓存穿透
  • 原文地址:https://www.cnblogs.com/stark-summer/p/4829751.html
Copyright © 2011-2022 走看看