hadoop FairScheduler 添加访问服务器和用户

来源:互联网 发布:微信朋友圈发淘宝链接 编辑:程序博客网 时间:2024/06/16 11:15

一、查看hadoop/conf/mapred-site.xml

找到以下代码,根据配置所示,要把新服务器的地址放到文件adminedHosts中,不要在  /usr/local/hadoop/conf/blackHosts中。


<property>

    <name>mapred.black.hosts</name>

    <value>/usr/local/hadoop/conf/blackHosts</value>

  </property>

  <property>

    <name>mapred.admined.hosts</name>

    <value>/usr/local/hadoop/conf/adminedHosts</value>

  </property>

二、查看hadoop/conf/mapred-site.xml,根据以下配置找到fair-scheduler.xml

 <property>
    <name>mapred.fairscheduler.allocation.file</name>
    <value>/usr/local/hadoop/conf/fair-scheduler.xml</value>
  </property>
  <property>


fair-scheduler.xml部分代码如下


<users>
  <user>zhangsan,lishi</user>
</users>
<common>
  <minMaps>100</minMaps>
  <minReduces>30</minReduces>
  <maxMaps>200</maxMaps>
  <maxReduces>60</maxReduces>
  <maxRunningJobs>2</maxRunningJobs>
  <maxTasksPerJob>8000</maxTasksPerJob>
  <weight>1.0</weight>
  <minSharePreemptionTimeout>30</minSharePreemptionTimeout>
</common>

在users项中加新用户,如果不是普通用户,则要设置special,如下。

<special name="rec">
  <minMaps>100</minMaps>
  <minReduces>20</minReduces>
  <maxMaps>600</maxMaps>
  <maxReduces>180</maxReduces>
  <maxRunningJobs>7</maxRunningJobs>
  <maxTasksPerJob>20000</maxTasksPerJob>
  <weight>1.0</weight>
  <minSharePreemptionTimeout>30</minSharePreemptionTimeout>
</special>


四、要使配置起作用,执行mapred  mradmin -refreshAdminList



0 0
原创粉丝点击