ResourceManager

    • YARN 클러스터의 Master 서버로 하나 또는 이중화를 위해 두개의 서버에만 실행됨
    • 클러스터 전체의 리소스를 관리
    • YARN 클러스터의 리소스를 사용하고자 하는 다른 플랫롬으로부터 요청을 받아 리소스 할당(스케줄링)

NodeManager

    • YARN 클러스터의 Worker 서버로 ResourceManager를 제외한 모든 서버에 실행
    • 사용자가 요청한 프로그램을 실행하는 Container fork 시키고 Container를 모니터링 Container 장애 상황 또는 Container가 요청한 리소스보다 많이 사용하고 있는지 감시(요청한 리소스보다 많이 사용하면 해당 Container kill 시킴)

 

Yarn Architecture

  • 1) 리소스매니저는 글러볼 스케줄러라고 정의할 수 있다. 리소스매니저는 전체 클러스터에서 가용한 모든 시스템 자원을 관리한다. 얀 클러스터에서 실행되는 애플리케이션이 리소스를 요청하면 이를 적절하게 분배하고, 리소스 사용 상태를 모니터링한다.

  • 2) 노드매니저는 맵리듀스의 태스크트래커의 기능을 담당한다. 태스크트래커가 각 슬레이브 서버마다 하나의 데몬이 실행된 것처럼 노드매니저도 각 슬레이브에서 하나의 데몬이 실행된다. 노드매니저는 컨테이너(Container)를 실행하고, 컨테이너의 라이프 사이클을 모니터링한다.

  • 3) 컨테이너는 노드매니저가 실행되는 서버의 시스템 자원을 표현한다. CPU, 메모리, 디스크, 네트워크 같은 다양한 시스템 자원을 표현한다. 맵리듀스의 태스크트래커가 태스크 단위로 잡을 실행했다면 노드매니저는 컨테이너 단위로 애플리케이션을 실행하고 각 상태를 스케줄링한다.

  • 4) 애플리케이션마스터는 하나의 애플리케이션을 관리하는 마스터 서버다. 클라이언트가 얀에 애플리케이션 실행을 요청하면 얀은 하나의 애플리케이션에 하나의 애플리케이셔마스터를 할당한다. 예를 들어, 얀 클러스터에 하나의 맵리듀스 잡과 하나의 스톰 애플리케이션 실행을 요청했다면 두 개의 애플리케이션마스터가 실행된다. 애플리케이션마스터는 애플리케이션에 필요한 리소스를 스케줄링하고, 노드매니저에 애플리케이션이 필요한 컨테이너를 실행할 것을 요청한다.

 

[빅데이터] 얀 리소스 매니저 API 호출

 

Command

#cmd
 GET "[ResourceManagerHost]/ws/v1/cluster/apps?param1=value1&param2=value2&param3=value3..."

# ex) if you want to return "states Running" by limit 20
 GET "http://ResourceManager.host.net:8088/ws/v1/cluster/apps?limit=20&states=RUNNING"

Return Example

  • You can Return  JSON Type
  • 예 )
    {"apps":{"app":[{"id":"application_1579679167074_XXXX","user":"hive","name":"SELECT\r\n\t*\r\nFROM\r\n(\r\n\tSELECT buy.univer...ac(Stage-2)","queue":"default","state":"KILLED","finalStatus":"KILLED","progress":100.0,"trackingUI":"History","trackingUrl":"http://namenode.host.net:8088/proxy/application_1579679167074_XXXX/","diagnostics":"Application killed by user.","clusterId":158218459XXXX,"applicationType":"MAPREDUCE","applicationTags":"","startedTime":1580883583147,"finishedTime":1580883604084,"elapsedTime":20937,"amContainerLogs":"http://datanode.host.net:8042/node/containerlogs/container_e96_15796791XXXX/hive","amHostHttpAddress":"datanode.host.net:8042","allocatedMB":-1,"allocatedVCores":-1,"runningContainers":-1,"memorySeconds":4133,"vcoreSeconds":4,"preemptedResourceMB":0,"preemptedResourceVCores":0,"numNonAMContainerPreempted":0,"numAMContainerPreempted":0,"logAggregationStatus":"NOT_START"}]}}

 

Reference :: Parameter List

 

Item Data Type Description
id string The application id
user string The user who started the application
name string The application name
Application Type string The application type
queue string The queue the application was submitted to
state string The application state according to the ResourceManager - valid values are members of the YarnApplicationState enum: NEW, NEW_SAVING, SUBMITTED, ACCEPTED, RUNNING, FINISHED, FAILED, KILLED
finalStatus string The final status of the application if finished - reported by the application itself - valid values are: UNDEFINED, SUCCEEDED, FAILED, KILLED
progress float The progress of the application as a percent
trackingUI string Where the tracking url is currently pointing - History (for history server) or ApplicationMaster
trackingUrl string The web URL that can be used to track the application
diagnostics string Detailed diagnostics information
clusterId long The cluster id
startedTime long The time in which application started (in ms since epoch)
finishedTime long The time in which the application finished (in ms since epoch)
elapsedTime long The elapsed time since the application started (in ms)
amContainerLogs string The URL of the application master container logs
amHostHttpAddress string The nodes http address of the application master
allocatedMB int The sum of memory in MB allocated to the application’s running containers
allocatedVCores int The sum of virtual cores allocated to the application’s running containers
runningContainers int The number of containers currently running for the application
memorySeconds long The amount of memory the application has allocated (megabyte-seconds)
vcoreSeconds long The amount of CPU resources the application has allocated (virtual core-seconds)
limit int the # of returns limit
 

+ Recent posts