Hadoop Yarn: How to limit dynamic self allocation of resources with Spark?

前端 未结 1 812
被撕碎了的回忆
被撕碎了的回忆 2021-01-12 08:39

In our Hadoop cluster that runs under Yarn we are having a problem that some \"smarter\" people are able to eat significantly larger chunks of resources by configuring Spark

1条回答
  •  悲哀的现实
    2021-01-12 08:54

    YARN have very good support for capacity planning in Multi-tenancy cluster by queues, YARN ResourceManager uses CapacityScheduler by default .

    Here we are taking queue name as alpha in spark submit for demo purpose.

    $ ./bin/spark-submit --class path/to/class/file \
        --master yarn-cluster \
        --queue alpha \
        jar/location \
        args
    

    Setup the queues:

    CapacityScheduler has a predefined queue called root. All queues in the system are children of the root queue. In capacity-scheduler.xml, parameter yarn.scheduler.capacity.root.queues is used to define the child queues;

    for example, to create 3 queues, specify the name of the queues in a comma separated list.

    
        yarn.scheduler.capacity.root.queues
        alpha,beta,default
        The queues at the this level (root is the root queue).
    
    

    These are few important properties to consider for capacity planning.

    
        yarn.scheduler.capacity.root.alpha.capacity
        50
        Queue capacity in percentage (%) as a float (e.g. 12.5). The sum of capacities for all queues, at each level, must be equal to 100. Applications in the queue may consume more resources than the queue’s capacity if there are free resources, providing elasticity.
    
    
    
        yarn.scheduler.capacity.root.alpha.maximum-capacity
        80
        Maximum queue capacity in percentage (%) as a float. This limits the elasticity for applications in the queue. Defaults to -1 which disables it.
    
    
    
        yarn.scheduler.capacity.root.alpha.minimum-capacity
        10
        Each queue enforces a limit on the percentage of resources allocated to a user at any given time, if there is demand for resources. The user limit can vary between a minimum and maximum value. The former (the minimum value) is set to this property value and the latter (the maximum value) depends on the number of users who have submitted applications. For e.g., suppose the value of this property is 25. If two users have submitted applications to a queue, no single user can use more than 50% of the queue resources. If a third user submits an application, no single user can use more than 33% of the queue resources. With 4 or more users, no user can use more than 25% of the queues resources. A value of 100 implies no user limits are imposed. The default is 100. Value is specified as a integer.
    
    

    links : YARN CapacityScheduler Queue Properties

    0 讨论(0)
提交回复
热议问题