Как ограничить динамическое самостоятельное распределение ресурсов в кластере Hadoop под Yarn?

в нашем кластере Hadoop, который работает под Yarn, у нас есть проблема, что некоторые "умные" люди могут есть значительно большие куски ресурсов, настраивая задания Spark в ноутбуках pySpark Jupyter, таких как:

conf = (SparkConf()
        .setAppName("name")
        .setMaster("yarn-client")
        .set("spark.executor.instances", "1000")
        .set("spark.executor.memory", "64g")
        )

sc = SparkContext(conf=conf)

Это приводит к ситуации, когда эти люди буквально выдавливают других, менее "умных".

есть ли способ запретить пользователям самостоятельно выделять ресурсы и оставить выделение ресурсов исключительно для Yarn?

1 ответов


пряжа имеет очень хорошую поддержку для планирования емкости в кластере Multi-tenancy очередями,пряжа объект ResourceManager использует CapacityScheduler по умолчанию .

здесь мы принимаем имя очереди как Альфа в spark отправить для демонстрационной цели.

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

настройка очередей:

CapacityScheduler имеет предопределенную очередь под названием root. Все очереди в системе являются дочерними для корневой очереди. В capacity-scheduler.xml, параметр yarn.scheduler.capacity.root.queues используется для определения очереди ребенка;

например, чтобы создать 3 очереди, Укажите имя очередей в списке, разделенном запятыми.

<property>
    <name>yarn.scheduler.capacity.root.queues</name>
    <value>alpha,beta,default</value>
    <description>The queues at the this level (root is the root queue).</description>
</property>

эти немногие важные свойства, котор нужно рассматривать для планирования емкости.

<property>
    <name>yarn.scheduler.capacity.root.alpha.capacity</name>
    <value>50</value>
    <description>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.</description>
</property>

<property>
    <name>yarn.scheduler.capacity.root.alpha.maximum-capacity</name>
    <value>80</value>
    <description>Maximum queue capacity in percentage (%) as a float. This limits the elasticity for applications in the queue. Defaults to -1 which disables it.</description>
</property>

<property>
    <name>yarn.scheduler.capacity.root.alpha.minimum-capacity</name>
    <value>10</value>
    <description>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.</description>
</property>

ссылки : свойства очереди CapacityScheduler пряжи