hadoop2.*能力调度器capacity-scheduler

capacity-scheduler能力调度器


1.  添加用户组dwgroup(集群中的namenode主备机器都要做以下操作)

groupadd dwgroup           //添加用户组

useradd -G  dwgroup 用户//将用户加到dwgroup用户组里

 

2.  yarn-site.xml

新增配置

<property>

<name>yarn.resourcemanager.scheduler.class</name>

<value>org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler</value>

</property>

 

去掉的配置

<!--llama set -->

<property>

<name>yarn.scheduler.minimum-allocation-mb</name>

<value>0</value>

</property>

<property>

<name>yarn.scheduler.minimum-allocation-vcores</name>

<value>0</value>

</property>

 

 

3.  capacity-scheduler.xml

更改的配置文件

<property>

   <name>yarn.scheduler.capacity.root.queues</name>

    <value>default,dwgroup</value>

    <description>

      The queues at the this level (root is theroot queue).

    </description>

  </property>

 

更改的配置

#--------------------default-----------------------------

<property>

   <name>yarn.scheduler.capacity.root.default.capacity</name>

    <value>30</value>

    <description>Defaultqueue target capacity.</description>

  </property>

 

  <property>

   <name>yarn.scheduler.capacity.root.default.user-limit-factor</name>

    <value>1</value>

    <description>

      Default queue user limita percentage from 0.0 to 1.0.

    </description>

  </property>

 

  <property>

 

  <name>yarn.scheduler.capacity.root.default.maximum-capacity</name>

   <value>100</value>

    <description>

      The maximum capacity ofthe default queue.

    </description>

  </property>

 

  <property>

   <name>yarn.scheduler.capacity.root.default.state</name>

   <value>RUNNING</value>

    <description>

      The state of the defaultqueue. State can be one of RUNNING or STOPPED.

    </description>

  </property>

 

  <property>

   <name>yarn.scheduler.capacity.root.default.acl_submit_applications</name>

   <value>*</value>

    <description>

      The ACL of who can submitjobs to the default queue.

    </description>

  </property>

 

  <property>

   <name>yarn.scheduler.capacity.root.default.acl_administer_queue</name>

   <value>*</value>

    <description>

      The ACL of who canadminister jobs on the default queue.

    </description>

  </property>

 

#------------------------dwgroup -----------------------------------

  <property>

 <name>yarn.scheduler.capacity.root.dwgroup.capacity</name>

  <value>70</value>

  <description>Defaultqueue target capacity.</description>

  </property>

 

  <property>

  <name>yarn.scheduler.capacity.root.dwgroup.user-limit-factor</name>

  <value>1</value>

  <description>

  Default queue user limit apercentage from 0.0 to 1.0.

  </description>

  </property>

 

  <property>

  <name>yarn.scheduler.capacity.root.dwgroup.maximum-capacity</name>

 <value>100</value>

  <description>

  The maximum capacity of thedefault queue.

  </description>

  </property>

 

  <property>

  <name>yarn.scheduler.capacity.root.dwgroup.state</name>

 <value>RUNNING</value>

  <description>

  The state of the defaultqueue. State can be one of RUNNING or STOPPED.

  </description>

  </property>

 

  <property>

 <name>yarn.scheduler.capacity.root.dwgroup.acl_submit_applications</name>

  <value>*</value>

  <description>

  The ACL of who can submitjobs to the default queue.

  </description>

  </property>

 

  <property>

 <name>yarn.scheduler.capacity.root.dwgroup.acl_administer_queue</name>

  <value>* </value>

  <description>

  The ACL of who canadminister jobs on the default queue.

  </description>

  </property>

 

更改的配置

<property>

   <name>yarn.scheduler.capacity.queue-mappings</name>

    <value>g:dwgroup:dwgroup,g:%:default</value>

    <description>

      A list of mappings that will be used toassign jobs to queues

      The syntax for this list is[u|g]:[name]:[queue_name][,next mapping]*

      Typically this list will be used to mapusers to queues,

      for example, u:%user:%user maps all usersto queues with the same name

      as the user.

    </description>

  </property>

 

更改完以上3个配置文件让配置文件生效

/data/hadoop/bin下执行以下命令

 

yarnrmadmin –refreshQueues

 

或者重启yarn执行以下命令

/data/hadoop/sbin/stop-yarn.sh

/data/hadoop/sbin/start-yarn.sh

 

 

 

 

注意:后续有新增用户,集群中的每台机器都要创建该用户,并且指定对应的dwgroup用户组

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值