日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

学习笔记Hadoop(十二)—— Hadoop基础操作(4)—— YARN资源管理与调度策略

發布時間:2025/3/21 编程问答 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 学习笔记Hadoop(十二)—— Hadoop基础操作(4)—— YARN资源管理与调度策略 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

六、YARN資源管理與調度策略

6.1、YARN資源管理

MapReduce任務/資源流程


由5.1章節我們可知,當把yarn.scheduler.capacity.maximum-am-resource-percent參數調整為0.2 時,我們可以同時運行2個任務,此時Application Master最大資源為5120M(每個任務啟動的AppMaster資源為2048M)

當參數調整為0.3時,可同時運行4個任務

6.2、YARN調度策略

Yarn的資源調度器是可配置的,Yarn定義了一套接口規范(接口ResourceScheduler),用戶可以按照自己的需求實現這個接口中的方法。

Yarn自身自帶了三種調度器,分別是:FIFO Scheduler、Capacity Scheduler和Fair Scheduler。



Yarn的資源調度器默認使用Capacity Scheduler,但是默認只有一個root.default隊列。


調整Yarn資源隊列

  • 添加dev,prod 隊列,刪除default隊列;
  • 修改default隊列配置為dev隊列,并修改其capacity為40 , maxium-capacity 為60 ;
  • 復制dev隊列屬性,并修改為prod隊列,修改其capacity為60 , maxium-capacity 為80 ;
  • 重啟YARN集群;
  • cd /opt/hadoop-3.1.4/etc/hadoop vi capacity-scheduler.xml

    修改如下:









    修改完后,配置prod,在dev末尾添加:

    <!-- config prod queue --><property><name>yarn.scheduler.capacity.root.prod.capacity</name><value>60</value><description>Default queue target capacity.</description></property><property><name>yarn.scheduler.capacity.root.prod.user-limit-factor</name><value>1</value><description>Default queue user limit a percentage from 0.0 to 1.0.</description></property><property><name>yarn.scheduler.capacity.root.prod.maximum-capacity</name><value>80</value><description>The maximum capacity of the default queue. </description></property><property><name>yarn.scheduler.capacity.root.prod.state</name><value>RUNNING</value><description>The state of the default queue. State can be one of RUNNING or STOPPED.</description></property><property><name>yarn.scheduler.capacity.root.prod.acl_submit_applications</name><value>*</value><description>The ACL of who can submit jobs to the default queue.</description></property><property><name>yarn.scheduler.capacity.root.prod.acl_administer_queue</name><value>*</value><description>The ACL of who can administer jobs on the default queue.</description></property><property><name>yarn.scheduler.capacity.root.prod.acl_application_max_priority</name><value>*</value><description>The ACL of who can submit applications with configured priority.For e.g, [user={name} group={name} max_priority={priority} default_priority={priority}]</description></property><property><name>yarn.scheduler.capacity.root.prod.maximum-application-lifetime</name><value>-1</value><description>Maximum lifetime of an application which is submitted to a queuein seconds. Any value less than or equal to zero will be considered asdisabled.This will be a hard time limit for all applications in thisqueue. If positive value is configured then any application submittedto this queue will be killed after exceeds the configured lifetime.User can also specify lifetime per application basis inapplication submission context. But user lifetime will beoverridden if it exceeds queue maximum lifetime. It is point-in-timeconfiguration.Note : Configuring too low value will result in killing applicationsooner. This feature is applicable only for leaf queue.</description></property><property><name>yarn.scheduler.capacity.root.prod.default-application-lifetime</name><value>-1</value><description>Default lifetime of an application which is submitted to a queuein seconds. Any value less than or equal to zero will be considered asdisabled.If the user has not submitted application with lifetime value then thisvalue will be taken. It is point-in-time configuration.Note : Default lifetime can't exceed maximum lifetime. This feature isapplicable only for leaf queue.</description></property>

    配置prod完后,保存、退出,拷貝到node1、node2、node3下:

    scp capacity-scheduler.xml node1:/opt/hadoop-3.1.4/etc/hadoop/ scp capacity-scheduler.xml node2:/opt/hadoop-3.1.4/etc/hadoop/ scp capacity-scheduler.xml node3:/opt/hadoop-3.1.4/etc/hadoop/

    最后,重啟下集群(進入sbin目錄)

    ./stop-yarn.sh ./start-yarn.sh

    啟動成功

    最后,我們查看下網頁的情況,瀏覽器網址輸入:

    master:8088

    OK,我們配置成功了!

    測試
    接下來,我們來測試一下:

    我們提交到dev隊列

    在網頁上我們可以看到任務已經提交了

    在網頁上,我們可以看占用資源查看:

    提交到prod隊列

    通過提交到dev和prod ,我們可以得出:不管是dev還是prod queue都不會占用Max_Capacity

    總結

    以上是生活随笔為你收集整理的学习笔记Hadoop(十二)—— Hadoop基础操作(4)—— YARN资源管理与调度策略的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。