지구정복

[Yarn] Fair Scheduler 본문

데이터 엔지니어링 정복/Yarn

[Yarn] Fair Scheduler

eeaarrtthh 2023. 7. 4. 07:25
728x90
반응형
SMALL

 

참고: https://hadoop.apache.org/docs/stable/hadoop-yarn/hadoop-yarn-site/FairScheduler.html

 

Apache Hadoop 3.3.6 – Hadoop: Fair Scheduler

<!--- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a

hadoop.apache.org

 


Introduction

 

Fair 스케줄러는 한 마디로 yarn에 제출되는 애플리케이션들에게 클러스터의 리소스를 공평하게 나눠주는 스케줄러이다.

 

각 큐에 리소스 최소량, 최대량을 설정하면 클러스터에 유휴 리소스가 많을 때 앱이 제출되면 해당 앱이 있는 큐가 사용할 수 있는 최대 자원을 할당받아서 처리하게되고,

클러스터에 이미 많은 앱이 실행중일 때에는 최소보장량을 할당받아서 처리하게 된다.

 

또한 특정 앱에 가중치를 주면 우선순위가 높아져 서비스 보장 수준을 충족시킬 수 있다.

 

 

 

* Fair 스케줄러는 큐를 통해 리소스를 분배한다.

Yarn의 기본값은 모든 유저들이 'default'라는 큐를 사용하도록 되어있다.

 

또한 특정 사용자는 특정 큐를 사용하도록 설정할 수 있다.

 

 

* 또한 각 유저마다 실행할 수 있는 최대 앱 수를 설정할 수 있고,

큐마다 최대 앱 수를 설정할 수 있다.

 

 

Hierarchical queues wilth pluggable policies

Fair 스케줄러는 계층형 큐 구조를 지원한다.

가장 최상단 큐는 'root'큐이다.

앱이 제출되면 root큐 밑에 있는 큐들에 할당된다.

 

root.parent1.child1

root.parent1.child2

root.parent2.child1

 

처럼 적용할 수 있다.

 

 

 

How to set Fair Scheduler

<property>  
 <name>yarn.resourcemanager.scheduler.class</name>  
 <value>org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler</value>  
</property>

 

* 설정값들

Property Description
yarn.scheduler.fair.allocation.file fair스케줄러의 설정값들을 적는 파일이 있는 위치
yarn.scheduler.fair.user-as-default-queue 큐에 할당되지 않은 사용자의 경우 큐 이름을 사용자 이름으로 쓸지 여부.
true면 큐 이름이 사용자 이름이 되고,
false면 default큐에서 실행된다.
yarn.scheduler.fair.preemption 자원 강제 확보 기능. 기본값은 false
yarn.scheduler.fair.preemption.cluster-utilization-threshold 클러스터의 전체 사용량이 이 설정값(0~1사이값)을 초과하면 우선순위가 낮은 앱의 자원을 강제 확보하여 우선순위가 높은 앱에 할당한다.
yarn.scheduler.fair.sizebasedweight 앱의 크기가 클수록 더 많은 자원을 할당받게하는 설정.
기본값 false
yarn.scheduler.fair.assignmultiple 한 번에 여러 앱에 리소스 할당하는 설정.
기본값은 false
yarn.scheduler.fair.dynamic.max.assign yarn.scheduler.fair.assignmultiple이 값이 true면 적용된다.
노드에서 유휴자원의 절반가량이 동적으로 할당된다.
기본값은 true이다.
yarn.scheduler.fair.max.assign yarn.scheduler.fair.assignmultiple이 값이 true이고 
yarn.scheduler.fair.dynamic.max.assign이 값이 false일 때 하나의 하트비트에 최대 몇 개의 컨테이너를 설정할 지 정할 수 있다. 기본값은 -1이고 제한이 없다는 의미이다.
   

 

 

 

 

 

 

 

 

 

 

 

 

728x90
반응형
LIST
Comments