CC00053.hadoop——|Hadoop&MapReduce.V25|——|Hadoop.v25|Yarn资源调度|多租户|资源隔离配置|

一、[Yarn资源调度之多租户的资源隔离配置]
### --- Yarn多租户资源隔离配置

~~~     Yarn集群资源设置为A,B两个队列,
~~~     A队列设置占用资源70%主要用来运行常规的定时任务,
~~~     B队列设置占用资源30%主要运行临时任务,
~~~     两个队列间可相互资源共享,假如A队列资源占满,B队列资源比较充裕,
~~~     A队列可以使用B队列的资源,使总体做到资源利用最大化.
~~~     选择使用Fair Scheduler调度策略!!
二、具体配置
### --- yarn-site.xml

[root@linux121 ~]# vim /opt/yanqi/servers/hadoop-2.9.2/etc/hadoop/yarn-site.xml
<!-- 指定我们的任务调度使用fairScheduler的调度方式 -->
<property>
    <name>yarn.resourcemanager.scheduler.class</name>
    <value>org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler</value>
    <description>In case you do not want to use the defaultscheduler</description>
</property>
 
### --- 发送到其它节点
[root@linux121 ~]# rsync-script /opt/yanqi/servers/hadoop-2.9.2/etc/hadoop/yarn-site.xml
### --- 创建fair-scheduler.xml文件
~~~     在Hadoop安装目录/etc/hadoop创建该文件

~~~     # 创建fair-scheduler.xml文件
[root@linux121 ~]# vim /opt/yanqi/servers/hadoop-2.9.2/etc/hadoop/fair-scheduler.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<allocations>
    <defaultQueueSchedulingPolicy>fair</defaultQueueSchedulingPolicy>
    <queue name="root" >
        <queue name="default">
            <aclAdministerApps>*</aclAdministerApps>
            <aclSubmitApps>*</aclSubmitApps>
            <maxResources>9216 mb,4 vcores</maxResources>
            <maxRunningApps>100</maxRunningApps>
            <minResources>1024 mb,1vcores</minResources>
            <minSharePreemptionTimeout>1000</minSharePreemptionTimeout>
            <schedulingPolicy>fair</schedulingPolicy>
            <weight>7</weight>
        </queue>
        <queue name="queue1">
            <aclAdministerApps>*</aclAdministerApps>
            <aclSubmitApps>*</aclSubmitApps>
            <maxResources>4096 mb,4vcores</maxResources>
            <maxRunningApps>5</maxRunningApps>
            <minResources>1024 mb, 1vcores</minResources>
            <minSharePreemptionTimeout>1000</minSharePreemptionTimeout>
            <schedulingPolicy>fair</schedulingPolicy>
            <weight>3</weight>
        </queue>
    </queue>
    <queuePlacementPolicy>
        <rule create="false" name="specified"/>
        <rule create="true" name="default"/>
    </queuePlacementPolicy>
</allocations>
 
### --- 发送到其它节点
[root@linux121 ~]# rsync-script /opt/yanqi/servers/hadoop-2.9.2/etc/hadoop/fair-scheduler.xml
### --- 重启yarn集群

[root@linux123 ~]# stop-yarn.sh
[root@linux123 ~]# start-yarn.sh
三、界面验证http://linux123:8088/cluster/scheduler:Scheduler
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

yanqi_vip

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值