YARN Capacity Scheduler: low-traffic cluster still billed for idle NodeManagers
0 reputation · 10 Aug 2021, 04:28 UTC
0 reputation · 10 Aug 2021, 04:28 UTC
Reduce operating cost for a low-traffic Hadoop YARN workload. The cluster sits mostly idle between small, occasional jobs, and I want to confine that workload to a small guaranteed Capacity Scheduler queue while cutting the resources that are paid for but unused.
Two documented levers seem relevant: shrinking the cluster through graceful NodeManager decommissioning (with a decommission timeout so running containers finish), or keeping the nodes and tightening queue capacity and maximum-capacity percentages so the workload cannot expand. Minimum-allocation memory and vcore settings may also force containers to reserve more than they use.
The unresolved decision is which lever is safer. NodeManagers are colocated with HDFS DataNodes, so removing nodes reduces storage capacity and risks under-replicated blocks if the cluster is not rebalanced first. YARN also has no built-in autoscaler, so any scale-down must come from the deployment environment. Assume a recent Hadoop 3.x release; exact property names should be confirmed against the deployed version.
35775 reputation · 10 Aug 2021, 09:59 UTC
For a low‑traffic YARN workload where NodeManagers also run HDFS DataNodes, the safer first cost‑reduction step is to tighten the guaranteed and maximum capacity of the target Capacity Scheduler queue rather than decommissioning nodes.
Decommissioning a NodeManager removes both compute and storage. If HDFS storage is near full or blocks are under‑replicated, removing a DataNode can cause under‑replicated blocks and potentially trigger namenode safemode. Tightening queue capacity leaves the NodeManager count unchanged, so HDFS replication and storage capacity stay intact while limiting the resources the workload can consume.
yarn.scheduler.capacity.root.<queue>.capacity (guaranteed) and ...maximum-capacity control the share of cluster resources the queue may use.yarn.scheduler.minimum-allocation-mb and -vcores) can cause containers to reserve more than they actually use, but they do not force the scheduler to allocate more containers than the queue’s capacity permits.capacity-scheduler.xml (or use the RM’s REST API) to reduce the queue’s capacity and optionally maximum-capacity to the desired levels, e.g., from 100% to 20% guaranteed and 40% maximum.yarn rmadmin -refreshQueues to reload the configuration without restarting the RM.If after tightening the queue the cluster still runs more NodeManagers than needed, decommissioning can be explored—but only after confirming that HDFS can tolerate the loss of storage.
What is the current HDFS storage utilization percentage (or the number of under‑replicated blocks)? If utilization is high (> 80 %) or there are under‑replicated blocks, decommissioning is unsafe; if utilization is low and replication is healthy, decommissioning may be considered.
hdfs dfsadmin -report and verify:
dfs.namenode.safemode.threshold-pct is not exceeded.hdfs fsck / -files -blocks -locations to confirm no corrupt or missing blocks.etc/hadoop/yarn.excludes (or the file pointed to by yarn.resourcemanager.nodes.exclude-path).yarn.resourcemanager.nodemanager-graceful-decommission-timeout-secs to a value longer than the longest expected container runtime.yarn rmadmin -refreshNodes to start the decommission process.Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.