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 jobs in pySpark Jupyter notebooks like:
conf = (SparkConf()
.setAppName("name")
.setMaster("yarn-client")
.set("spark.executor.instances", "1000")
.set("spark.executor.memory", "64g")
)
sc = SparkContext(conf=conf)
This leads to the situation when these people literally squeeze out others less "smarter".
Is there a way to forbid users to self-allocate resources and leave resource allocation solely to Yarn?
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.
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
, parameteryarn.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.
These are few important properties to consider for capacity planning.
links : YARN CapacityScheduler Queue Properties