blob: 8c6a96d6b2f5a75639b8096704a23130cf996319 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
| Generated by Apache Maven Doxia at 2021-06-15
| Rendered using Apache Maven Stylus Skin 1.5
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Apache Hadoop 3.3.1 &#x2013; Hadoop: YARN Resource Configuration</title>
<style type="text/css" media="all">
@import url("./css/maven-base.css");
@import url("./css/maven-theme.css");
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
<meta name="Date-Revision-yyyymmdd" content="20210615" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body class="composite">
<div id="banner">
<a href="http://hadoop.apache.org/" id="bannerLeft">
<img src="http://hadoop.apache.org/images/hadoop-logo.jpg" alt="" />
</a>
<a href="http://www.apache.org/" id="bannerRight">
<img src="http://www.apache.org/images/asf_logo_wide.png" alt="" />
</a>
<div class="clear">
<hr/>
</div>
</div>
<div id="breadcrumbs">
<div class="xleft">
<a href="http://www.apache.org/" class="externalLink">Apache</a>
&gt;
<a href="http://hadoop.apache.org/" class="externalLink">Hadoop</a>
&gt;
<a href="../index.html">Apache Hadoop YARN</a>
&gt;
<a href="index.html">Apache Hadoop 3.3.1</a>
&gt;
Hadoop: YARN Resource Configuration
</div>
<div class="xright"> <a href="http://wiki.apache.org/hadoop" class="externalLink">Wiki</a>
|
<a href="https://gitbox.apache.org/repos/asf/hadoop.git" class="externalLink">git</a>
|
<a href="http://hadoop.apache.org/" class="externalLink">Apache Hadoop</a>
&nbsp;| Last Published: 2021-06-15
&nbsp;| Version: 3.3.1
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="leftColumn">
<div id="navcolumn">
<h5>General</h5>
<ul>
<li class="none">
<a href="../../index.html">Overview</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/SingleCluster.html">Single Node Setup</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/ClusterSetup.html">Cluster Setup</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/CommandsManual.html">Commands Reference</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/FileSystemShell.html">FileSystem Shell</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/Compatibility.html">Compatibility Specification</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/DownstreamDev.html">Downstream Developer's Guide</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/AdminCompatibilityGuide.html">Admin Compatibility Guide</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/InterfaceClassification.html">Interface Classification</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/filesystem/index.html">FileSystem Specification</a>
</li>
</ul>
<h5>Common</h5>
<ul>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/CLIMiniCluster.html">CLI Mini Cluster</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/FairCallQueue.html">Fair Call Queue</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/NativeLibraries.html">Native Libraries</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/Superusers.html">Proxy User</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/RackAwareness.html">Rack Awareness</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/SecureMode.html">Secure Mode</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/ServiceLevelAuth.html">Service Level Authorization</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/HttpAuthentication.html">HTTP Authentication</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/CredentialProviderAPI.html">Credential Provider API</a>
</li>
<li class="none">
<a href="../../hadoop-kms/index.html">Hadoop KMS</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/Tracing.html">Tracing</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/UnixShellGuide.html">Unix Shell Guide</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/registry/index.html">Registry</a>
</li>
</ul>
<h5>HDFS</h5>
<ul>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsDesign.html">Architecture</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsUserGuide.html">User Guide</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HDFSCommands.html">Commands Reference</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithQJM.html">NameNode HA With QJM</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithNFS.html">NameNode HA With NFS</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/ObserverNameNode.html">Observer NameNode</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/Federation.html">Federation</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/ViewFs.html">ViewFs</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/ViewFsOverloadScheme.html">ViewFsOverloadScheme</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsSnapshots.html">Snapshots</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsEditsViewer.html">Edits Viewer</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsImageViewer.html">Image Viewer</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsPermissionsGuide.html">Permissions and HDFS</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsQuotaAdminGuide.html">Quotas and HDFS</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/LibHdfs.html">libhdfs (C API)</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/WebHDFS.html">WebHDFS (REST API)</a>
</li>
<li class="none">
<a href="../../hadoop-hdfs-httpfs/index.html">HttpFS</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/ShortCircuitLocalReads.html">Short Circuit Local Reads</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/CentralizedCacheManagement.html">Centralized Cache Management</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsNfsGateway.html">NFS Gateway</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsRollingUpgrade.html">Rolling Upgrade</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/ExtendedAttributes.html">Extended Attributes</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/TransparentEncryption.html">Transparent Encryption</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsMultihoming.html">Multihoming</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/ArchivalStorage.html">Storage Policies</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/MemoryStorage.html">Memory Storage Support</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/SLGUserGuide.html">Synthetic Load Generator</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HDFSErasureCoding.html">Erasure Coding</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HDFSDiskbalancer.html">Disk Balancer</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsUpgradeDomain.html">Upgrade Domain</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsDataNodeAdminGuide.html">DataNode Admin</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs-rbf/HDFSRouterFederation.html">Router Federation</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/HdfsProvidedStorage.html">Provided Storage</a>
</li>
</ul>
<h5>MapReduce</h5>
<ul>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html">Tutorial</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapredCommands.html">Commands Reference</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduce_Compatibility_Hadoop1_Hadoop2.html">Compatibility with 1.x</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/EncryptedShuffle.html">Encrypted Shuffle</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/PluggableShuffleAndPluggableSort.html">Pluggable Shuffle/Sort</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/DistributedCacheDeploy.html">Distributed Cache Deploy</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/SharedCacheSupport.html">Support for YARN Shared Cache</a>
</li>
</ul>
<h5>MapReduce REST APIs</h5>
<ul>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapredAppMasterRest.html">MR Application Master</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-hs/HistoryServerRest.html">MR History Server</a>
</li>
</ul>
<h5>YARN</h5>
<ul>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/YARN.html">Architecture</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/YarnCommands.html">Commands Reference</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/CapacityScheduler.html">Capacity Scheduler</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/FairScheduler.html">Fair Scheduler</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/ResourceManagerRestart.html">ResourceManager Restart</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/ResourceManagerHA.html">ResourceManager HA</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/ResourceModel.html">Resource Model</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/NodeLabel.html">Node Labels</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/NodeAttributes.html">Node Attributes</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/WebApplicationProxy.html">Web Application Proxy</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/TimelineServer.html">Timeline Server</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/TimelineServiceV2.html">Timeline Service V.2</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/WritingYarnApplications.html">Writing YARN Applications</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/YarnApplicationSecurity.html">YARN Application Security</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/NodeManager.html">NodeManager</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/DockerContainers.html">Running Applications in Docker Containers</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/RuncContainers.html">Running Applications in runC Containers</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/NodeManagerCgroups.html">Using CGroups</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/SecureContainer.html">Secure Containers</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/ReservationSystem.html">Reservation System</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/GracefulDecommission.html">Graceful Decommission</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/OpportunisticContainers.html">Opportunistic Containers</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/Federation.html">YARN Federation</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/SharedCache.html">Shared Cache</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/UsingGpus.html">Using GPU</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/UsingFPGA.html">Using FPGA</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/PlacementConstraints.html">Placement Constraints</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/YarnUI2.html">YARN UI2</a>
</li>
</ul>
<h5>YARN REST APIs</h5>
<ul>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/WebServicesIntro.html">Introduction</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html">Resource Manager</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/NodeManagerRest.html">Node Manager</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/TimelineServer.html#Timeline_Server_REST_API_v1">Timeline Server</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/TimelineServiceV2.html#Timeline_Service_v.2_REST_API">Timeline Service V.2</a>
</li>
</ul>
<h5>YARN Service</h5>
<ul>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/Overview.html">Overview</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/QuickStart.html">QuickStart</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/Concepts.html">Concepts</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/YarnServiceAPI.html">Yarn Service API</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/ServiceDiscovery.html">Service Discovery</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-site/yarn-service/SystemServices.html">System Services</a>
</li>
</ul>
<h5>Hadoop Compatible File Systems</h5>
<ul>
<li class="none">
<a href="../../hadoop-aliyun/tools/hadoop-aliyun/index.html">Aliyun OSS</a>
</li>
<li class="none">
<a href="../../hadoop-aws/tools/hadoop-aws/index.html">Amazon S3</a>
</li>
<li class="none">
<a href="../../hadoop-azure/index.html">Azure Blob Storage</a>
</li>
<li class="none">
<a href="../../hadoop-azure-datalake/index.html">Azure Data Lake Storage</a>
</li>
<li class="none">
<a href="../../hadoop-openstack/index.html">OpenStack Swift</a>
</li>
<li class="none">
<a href="../../hadoop-cos/cloud-storage/index.html">Tencent COS</a>
</li>
</ul>
<h5>Auth</h5>
<ul>
<li class="none">
<a href="../../hadoop-auth/index.html">Overview</a>
</li>
<li class="none">
<a href="../../hadoop-auth/Examples.html">Examples</a>
</li>
<li class="none">
<a href="../../hadoop-auth/Configuration.html">Configuration</a>
</li>
<li class="none">
<a href="../../hadoop-auth/BuildingIt.html">Building</a>
</li>
</ul>
<h5>Tools</h5>
<ul>
<li class="none">
<a href="../../hadoop-streaming/HadoopStreaming.html">Hadoop Streaming</a>
</li>
<li class="none">
<a href="../../hadoop-archives/HadoopArchives.html">Hadoop Archives</a>
</li>
<li class="none">
<a href="../../hadoop-archive-logs/HadoopArchiveLogs.html">Hadoop Archive Logs</a>
</li>
<li class="none">
<a href="../../hadoop-distcp/DistCp.html">DistCp</a>
</li>
<li class="none">
<a href="../../hadoop-gridmix/GridMix.html">GridMix</a>
</li>
<li class="none">
<a href="../../hadoop-rumen/Rumen.html">Rumen</a>
</li>
<li class="none">
<a href="../../hadoop-resourceestimator/ResourceEstimator.html">Resource Estimator Service</a>
</li>
<li class="none">
<a href="../../hadoop-sls/SchedulerLoadSimulator.html">Scheduler Load Simulator</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/Benchmarking.html">Hadoop Benchmarking</a>
</li>
<li class="none">
<a href="../../hadoop-dynamometer/Dynamometer.html">Dynamometer</a>
</li>
</ul>
<h5>Reference</h5>
<ul>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/release/">Changelog and Release Notes</a>
</li>
<li class="none">
<a href="../../api/index.html">Java API docs</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/UnixShellAPI.html">Unix Shell API</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/Metrics.html">Metrics</a>
</li>
</ul>
<h5>Configuration</h5>
<ul>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/core-default.xml">core-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs/hdfs-default.xml">hdfs-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-hdfs-rbf/hdfs-rbf-default.xml">hdfs-rbf-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/mapred-default.xml">mapred-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-yarn/hadoop-yarn-common/yarn-default.xml">yarn-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-kms/kms-default.html">kms-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-hdfs-httpfs/httpfs-default.html">httpfs-default.xml</a>
</li>
<li class="none">
<a href="../../hadoop-project-dist/hadoop-common/DeprecatedProperties.html">Deprecated Properties</a>
</li>
</ul>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img alt="Built by Maven" src="./images/logos/maven-feather.png"/>
</a>
</div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<h1>Hadoop: YARN Resource Configuration</h1>
<div class="section">
<h2><a name="Overview"></a>Overview</h2>
<p>YARN supports an extensible resource model. By default YARN tracks CPU and memory for all nodes, applications, and queues, but the resource definition can be extended to include arbitrary &#x201c;countable&#x201d; resources. A countable resource is a resource that is consumed while a container is running, but is released afterwards. CPU and memory are both countable resources. Other examples include GPU resources and software licenses.</p>
<p>In addition, YARN also supports the use of &#x201c;resource profiles&#x201d;, which allow a user to specify multiple resource requests through a single profile, similar to Amazon Web Services Elastic Compute Cluster instance types. For example, &#x201c;large&#x201d; might mean 8 virtual cores and 16GB RAM.</p></div>
<div class="section">
<h2><a name="Configuration"></a>Configuration</h2>
<p>The following configuration properties are supported. See below for details.</p>
<p><tt>yarn-site.xml</tt></p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Configuration Property </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> <tt>yarn.resourcemanager.resource-profiles.enabled</tt> </td>
<td align="left"> Indicates whether resource profiles support is enabled. Defaults to <tt>false</tt>. </td></tr>
</tbody>
</table>
<p><tt>resource-types.xml</tt></p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Configuration Property </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> <tt>yarn.resource-types</tt> </td>
<td align="left"> Comma-separated list of additional resources. May not include <tt>memory</tt>, <tt>memory-mb</tt>, or <tt>vcores</tt> </td></tr>
<tr class="a">
<td align="left"> <tt>yarn.resource-types.&lt;resource&gt;.units</tt> </td>
<td align="left"> Default unit for the specified resource type </td></tr>
<tr class="b">
<td align="left"> <tt>yarn.resource-types.&lt;resource&gt;.minimum-allocation</tt> </td>
<td align="left"> The minimum request for the specified resource type </td></tr>
<tr class="a">
<td align="left"> <tt>yarn.resource-types.&lt;resource&gt;.maximum-allocation</tt> </td>
<td align="left"> The maximum request for the specified resource type </td></tr>
</tbody>
</table>
<p><tt>node-resources.xml</tt></p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Configuration Property </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> <tt>yarn.nodemanager.resource-type.&lt;resource&gt;</tt> </td>
<td align="left"> The count of the specified resource available from the node manager </td></tr>
</tbody>
</table>
<p>Please note that the <tt>resource-types.xml</tt> and <tt>node-resources.xml</tt> files also need to be placed in the same configuration directory as <tt>yarn-site.xml</tt> if they are used. Alternatively, the properties may be placed into the <tt>yarn-site.xml</tt> file instead.</p></div>
<div class="section">
<h2><a name="YARN_Resource_Model"></a>YARN Resource Model</h2>
<div class="section">
<h3><a name="Resource_Manager"></a>Resource Manager</h3>
<p>The resource manager is the final arbiter of what resources in the cluster are tracked. The resource manager loads its resource definition from XML configuration files. For example, to define a new resource in addition to CPU and memory, the following property should be configured:</p>
<div>
<div>
<pre class="source">&lt;configuration&gt;
&lt;property&gt;
&lt;name&gt;yarn.resource-types&lt;/name&gt;
&lt;value&gt;resource1,resource2&lt;/value&gt;
&lt;description&gt;
The resources to be used for scheduling. Use resource-types.xml
to specify details about the individual resource types.
&lt;/description&gt;
&lt;/property&gt;
&lt;/configuration&gt;
</pre></div></div>
<p>A valid resource name must begin with a letter and contain only letters, numbers, and any of: &#x2018;.&#x2019;, &#x2018;_&#x2019;, or &#x2018;-&#x2019;. A valid resource name may also be optionally preceded by a name space followed by a slash. A valid name space consists of period-separated groups of letters, numbers, and dashes. For example, the following are valid resource names:</p>
<ul>
<li>myresource</li>
<li>my_resource</li>
<li>My-Resource01</li>
<li>com.acme/myresource</li>
</ul>
<p>The following are examples of invalid resource names:</p>
<ul>
<li>10myresource</li>
<li>my resource</li>
<li>com/acme/myresource</li>
<li>$NS/myresource</li>
<li>-none-/myresource</li>
</ul>
<p>For each new resource type defined an optional unit property can be added to set the default unit for the resource type. Valid values are:</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left">Unit Name </th>
<th align="left"> Meaning </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> p </td>
<td align="left"> pico </td></tr>
<tr class="a">
<td align="left"> n </td>
<td align="left"> nano </td></tr>
<tr class="b">
<td align="left"> u </td>
<td align="left"> micro </td></tr>
<tr class="a">
<td align="left"> m </td>
<td align="left"> milli </td></tr>
<tr class="b">
<td align="left"> </td>
<td align="left"> default, i.e. no unit </td></tr>
<tr class="a">
<td align="left"> k </td>
<td align="left"> kilo </td></tr>
<tr class="b">
<td align="left"> M </td>
<td align="left"> mega </td></tr>
<tr class="a">
<td align="left"> G </td>
<td align="left"> giga </td></tr>
<tr class="b">
<td align="left"> T </td>
<td align="left"> tera </td></tr>
<tr class="a">
<td align="left"> P </td>
<td align="left"> peta </td></tr>
<tr class="b">
<td align="left"> Ki </td>
<td align="left"> binary kilo, i.e. 1024 </td></tr>
<tr class="a">
<td align="left"> Mi </td>
<td align="left"> binary mega, i.e. 1024^2 </td></tr>
<tr class="b">
<td align="left"> Gi </td>
<td align="left"> binary giga, i.e. 1024^3 </td></tr>
<tr class="a">
<td align="left"> Ti </td>
<td align="left"> binary tera, i.e. 1024^4 </td></tr>
<tr class="b">
<td align="left"> Pi </td>
<td align="left"> binary peta, i.e. 1024^5 </td></tr>
</tbody>
</table>
<p>The property must be named <tt>yarn.resource-types.&lt;resource&gt;.units</tt>. Each defined resource may also have optional minimum and maximum properties. The properties must be named <tt>yarn.resource-types.&lt;resource&gt;.minimum-allocation</tt> and <tt>yarn.resource-types.&lt;resource&gt;.maximum-allocation</tt>.</p>
<p>The <tt>yarn.resource-types</tt> property and any unit, mimimum, or maximum properties may be defined in either the usual <tt>yarn-site.xml</tt> file or in a file named <tt>resource-types.xml</tt>. For example, the following could appear in either file:</p>
<div>
<div>
<pre class="source">&lt;configuration&gt;
&lt;property&gt;
&lt;name&gt;yarn.resource-types&lt;/name&gt;
&lt;value&gt;resource1, resource2&lt;/value&gt;
&lt;/property&gt;
&lt;property&gt;
&lt;name&gt;yarn.resource-types.resource1.units&lt;/name&gt;
&lt;value&gt;G&lt;/value&gt;
&lt;/property&gt;
&lt;property&gt;
&lt;name&gt;yarn.resource-types.resource2.minimum-allocation&lt;/name&gt;
&lt;value&gt;1&lt;/value&gt;
&lt;/property&gt;
&lt;property&gt;
&lt;name&gt;yarn.resource-types.resource2.maximum-allocation&lt;/name&gt;
&lt;value&gt;1024&lt;/value&gt;
&lt;/property&gt;
&lt;/configuration&gt;
</pre></div></div>
</div>
<div class="section">
<h3><a name="Node_Manager"></a>Node Manager</h3>
<p>Each node manager independently defines the resources that are available from that node. The resource definition is done through setting a property for each available resource. The property must be named <tt>yarn.nodemanager.resource-type.&lt;resource&gt;</tt> and may be placed in the usual <tt>yarn-site.xml</tt> file or in a file named <tt>node&#xad;resources.xml</tt>. The value of the property should be the amount of that resource offered by the node. For example:</p>
<div>
<div>
<pre class="source">&lt;configuration&gt;
&lt;property&gt;
&lt;name&gt;yarn.nodemanager.resource-type.resource1&lt;/name&gt;
&lt;value&gt;5G&lt;/value&gt;
&lt;/property&gt;
&lt;property&gt;
&lt;name&gt;yarn.nodemanager.resource-type.resource2&lt;/name&gt;
&lt;value&gt;2m&lt;/value&gt;
&lt;/property&gt;
&lt;/configuration&gt;
</pre></div></div>
<p>Note that the units used for these resources need not match the definition held by the resource manager. If the units do not match, the resource manager will automatically do a conversion.</p></div>
<div class="section">
<h3><a name="Using_Resources_With_MapReduce"></a>Using Resources With MapReduce</h3>
<p>MapReduce requests three different kinds of containers from YARN: the application master container, map containers, and reduce containers. For each container type, there is a corresponding set of properties that can be used to set the resources requested.</p>
<p>The properties for setting resource requests in MapReduce are:</p>
<table border="0" class="bodyTable">
<thead>
<tr class="a">
<th align="left"> Property </th>
<th align="left"> Description </th></tr>
</thead><tbody>
<tr class="b">
<td align="left"> <tt>yarn.app.mapreduce.am.resource.mb</tt> </td>
<td align="left"> Sets the memory requested for the application master container to the value in MB. No longer preferred. Use <tt>yarn.app.mapreduce.am.resource.memory-mb</tt> instead. Defaults to 1536. </td></tr>
<tr class="a">
<td align="left"> <tt>yarn.app.mapreduce.am.resource.memory</tt> </td>
<td align="left"> Sets the memory requested for the application master container to the value in MB. No longer preferred. Use <tt>yarn.app.mapreduce.am.resource.memory-mb</tt> instead. Defaults to 1536. </td></tr>
<tr class="b">
<td align="left"> <tt>yarn.app.mapreduce.am.resource.memory-mb</tt> </td>
<td align="left"> Sets the memory requested for the application master container to the value in MB. Defaults to 1536. </td></tr>
<tr class="a">
<td align="left"> <tt>yarn.app.mapreduce.am.resource.cpu-vcores</tt> </td>
<td align="left"> Sets the CPU requested for the application master container to the value. No longer preferred. Use <tt>yarn.app.mapreduce.am.resource.vcores</tt> instead. Defaults to 1. </td></tr>
<tr class="b">
<td align="left"> <tt>yarn.app.mapreduce.am.resource.vcores</tt> </td>
<td align="left"> Sets the CPU requested for the application master container to the value. Defaults to 1. </td></tr>
<tr class="a">
<td align="left"> <tt>yarn.app.mapreduce.am.resource.&lt;resource&gt;</tt> </td>
<td align="left"> Sets the quantity requested of <tt>&lt;resource&gt;</tt> for the application master container to the value. If no unit is specified, the default unit for the resource is assumed. See the section on units above. </td></tr>
<tr class="b">
<td align="left"> <tt>mapreduce.map.memory.mb</tt> </td>
<td align="left"> Sets the memory requested for the all map task containers to the value in MB. No longer preferred. Use <tt>mapreduce.map.resource.memory-mb</tt> instead. Defaults to 1024. </td></tr>
<tr class="a">
<td align="left"> <tt>mapreduce.map.resource.memory</tt> </td>
<td align="left"> Sets the memory requested for the all map task containers to the value in MB. No longer preferred. Use <tt>mapreduce.map.resource.memory-mb</tt> instead. Defaults to 1024. </td></tr>
<tr class="b">
<td align="left"> <tt>mapreduce.map.resource.memory-mb</tt> </td>
<td align="left"> Sets the memory requested for the all map task containers to the value in MB. Defaults to 1024. </td></tr>
<tr class="a">
<td align="left"> <tt>mapreduce.map.cpu.vcores</tt> </td>
<td align="left"> Sets the CPU requested for the all map task containers to the value. No longer preferred. Use <tt>mapreduce.map.resource.vcores</tt> instead. Defaults to 1. </td></tr>
<tr class="b">
<td align="left"> <tt>mapreduce.map.resource.vcores</tt> </td>
<td align="left"> Sets the CPU requested for the all map task containers to the value. Defaults to 1. </td></tr>
<tr class="a">
<td align="left"> <tt>mapreduce.map.resource.&lt;resource&gt;</tt> </td>
<td align="left"> Sets the quantity requested of <tt>&lt;resource&gt;</tt> for the all map task containers to the value. If no unit is specified, the default unit for the resource is assumed. See the section on units above. </td></tr>
<tr class="b">
<td align="left"> <tt>mapreduce.reduce.memory.mb</tt> </td>
<td align="left"> Sets the memory requested for the all reduce task containers to the value in MB. No longer preferred. Use <tt>mapreduce.reduce.resource.memory-mb</tt> instead. Defaults to 1024. </td></tr>
<tr class="a">
<td align="left"> <tt>mapreduce.reduce.resource.memory</tt> </td>
<td align="left"> Sets the memory requested for the all reduce task containers to the value in MB. No longer preferred. Use <tt>mapreduce.reduce.resource.memory-mb</tt> instead. Defaults to 1024. </td></tr>
<tr class="b">
<td align="left"> <tt>mapreduce.reduce.resource.memory-mb</tt> </td>
<td align="left"> Sets the memory requested for the all reduce task containers to the value in MB. Defaults to 1024. </td></tr>
<tr class="a">
<td align="left"> <tt>mapreduce.reduce.cpu.vcores</tt> </td>
<td align="left"> Sets the CPU requested for the all reduce task containers to the value. No longer preferred. Use <tt>mapreduce.reduce.resource.vcores</tt> instead. Defaults to 1. </td></tr>
<tr class="b">
<td align="left"> <tt>mapreduce.reduce.resource.vcores</tt> </td>
<td align="left"> Sets the CPU requested for the all reduce task containers to the value. Defaults to 1. </td></tr>
<tr class="a">
<td align="left"> <tt>mapreduce.reduce.resource.&lt;resource&gt;</tt> </td>
<td align="left"> Sets the quantity requested of <tt>&lt;resource&gt;</tt> for the all reduce task containers to the value. If no unit is specified, the default unit for the resource is assumed. See the section on units above. </td></tr>
</tbody>
</table>
<p>Note that these resource requests may be modified by YARN to meet the configured minimum and maximum resource values or to be a multiple of the configured increment. See the <tt>yarn.scheduler.maximum-allocation-mb</tt>, <tt>yarn.scheduler.minimum-allocation-mb</tt>, <tt>yarn.scheduler.increment-allocation-mb</tt>, <tt>yarn.scheduler.maximum-allocation-vcores</tt>, <tt>yarn.scheduler.minimum-allocation-vcores</tt>, and <tt>yarn.scheduler.increment-allocation-vcores</tt> properties in the YARN scheduler configuration.</p></div></div>
<div class="section">
<h2><a name="Resource_Profiles"></a>Resource Profiles</h2>
<p>Resource profiles provides an easy way for users to request a set of resources with a single profile and a means for administrators to regulate how resources are consumed.</p>
<p>To configure resource types, the administrator must set <tt>yarn.resourcemanager.resource-profiles.enabled</tt> to <tt>true</tt> in the resource manager&#x2019;s <tt>yarn-site.xml</tt> file. This file defines the supported profiles. For example:</p>
<div>
<div>
<pre class="source">{
&quot;small&quot;: {
&quot;memory-mb&quot; : 1024,
&quot;vcores&quot; : 1
},
&quot;default&quot; : {
&quot;memory-mb&quot; : 2048,
&quot;vcores&quot; : 2
},
&quot;large&quot; : {
&quot;memory-mb&quot;: 4096,
&quot;vcores&quot; : 4
},
&quot;compute&quot; : {
&quot;memory-mb&quot; : 2048,
&quot;vcores&quot; : 2,
&quot;gpu&quot; : 1
}
}
</pre></div></div>
<p>In this example, users have access to four profiles with different resource settings. Note that in the <tt>compute</tt> profile, the administrator has configured an additional resource as described above.</p>
<div class="section">
<h3><a name="Requesting_Profiles"></a>Requesting Profiles</h3>
<p>The distributed shell is currently the only client that supports resource profiles. Using the distributed shell, the user can specify a resource profile name which will automatically be translated into an appropriate set of resource requests.</p>
<p>For example:</p>
<p><tt>hadoop job $DISTSHELL -jar $DISTSHELL -shell_command run.sh -container_resource_profile small</tt></p></div></div>
</div>
</div>
<div class="clear">
<hr/>
</div>
<div id="footer">
<div class="xright">
&#169; 2008-2021
Apache Software Foundation
- <a href="http://maven.apache.org/privacy-policy.html">Privacy Policy</a>.
Apache Maven, Maven, Apache, the Apache feather logo, and the Apache Maven project logos are trademarks of The Apache Software Foundation.
</div>
<div class="clear">
<hr/>
</div>
</div>
</body>
</html>