diff --git hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/ResourceProfiles.md hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/ResourceProfiles.md index d422ab685f8..906c837aaaa 100644 --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/ResourceProfiles.md +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/ResourceProfiles.md @@ -15,16 +15,104 @@ limitations under the License. --> -Hadoop: YARN Resource Profiles -============================== +Hadoop: YARN Resource Configuration +=================================== Overview -------- -Resource profiles support in YARN helps to extend the YARN resource model to a more flexible model which makes it easier to add new countable resource­types. This solution also helps the users to submit jobs with ease to specify the resources they need. +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 "countable" 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. + +Configuration +------------- + +The following configuration properties are supported. See below for details. + +`yarn-site.xml` + +| Configuration Property | Description | +|:---- |:---- | +| `yarn.resourcemanager.resource-profiles.enabled` | *(Required)* In the server side it indicates whether resource profiles support is enabled or not. Defaults to `false`. | +| `yarn.resource-types` | Comma-separated list of additional resources. May not include `memory`, `memory-mb`, or `vcores` | +| `yarn.resource-types..units` | Default unit for the specified resource type | +| `yarn.resource-types..minimum` | The minimum request for the specified resource type | +| `yarn.resource-types..maximum` | The maximum request for the specified resource type | +| `yarn.nodemanager.resource-type.` | The count of the specified resource available from the node manager | + +`resource-types.xml` + +| Configuration Property | Value | Description | +|:---- |:---- |:---- | +| `yarn.resource-types` | Comma-separated list of additional resources. May not include `memory`, `memory-mb`, or `vcores` | +| `yarn.resource-types..units` | Default unit for the specified resource type | +| `yarn.resource-types..minimum` | The minimum request for the specified resource type | +| `yarn.resource-types..maximum` | The maximum request for the specified resource type | + +`node­-resources.xml` + +| Configuration Property | Value | Description | +|:---- |:---- |:---- | +| `yarn.nodemanager.resource-type.` | The count of the specified resource available from the node manager | + +Please note that the `resource-types.xml` and `node­-resources.xml` files +also need to be placed in same configuration directory as `yarn-site.xml` if +they are used. + +YARN Resource Model +------------------- -Resource model of YARN ------------------------ -Resource Manager will load a new configuration file named `resource-types.xml` to determine the set of resource ­types for which scheduling is enabled. Sample XML will look like below. +### Resource Manager +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. To define resource types in addition to CPU and memory, +the following property must be configured: + +```xml + + + yarn.resource-types + + + The resource types to be used for scheduling. Use resource-types.xml + to specify details about the individual resource types. + + + +``` + +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: + +|Unit Name | Meaning | +|:---- |:---- | +| p | pico | +| n | nano | +| u | micro | +| m | milli | +| | default, i.e. no unit | +| k | kilo | +| M | mega | +| G | giga | +| T | tera | +| P | peta | +| Ki | binary kilo, i.e. 1024 | +| Mi | binary mega, i.e. 1024^2 | +| Gi | binary giga, i.e. 1024^3 | +| Ti | binary tera, i.e. 1024^4 | +| Pi | binary peta, i.e. 1024^5 | + +The property must be named `yarn.resource-types..units`. Each defined +resource may also have optional minimum and maximum properties. The properties +must be named `yarn.resource-types..minimum` and +`yarn.resource-types..maximum`. + +The `yarn.resource-types` property and any unit, mimimum, or maximum properties +may be defined in either the usual `yarn-site.xml` file or in a file named +`resource-types.xml`. For example, the following could appear in either file: ```xml @@ -37,10 +125,28 @@ Resource Manager will load a new configuration file named `resource-types.xml` t yarn.resource-types.resource1.units G + + + yarn.resource-types.resource2.minimum + 1 + + + + yarn.resource-types.resource2.maximum + 1024 + ``` -Similarly, a new configuration file `node­-resources.xml` will also be loaded by Node Manager where the resource capabilities of a node can be specified. +### Node Manager + +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 +`yarn.nodemanager.resource-type.` and may be placed in the usual +`yarn-site.xml` file or in a file named `node­resources.xml`. The value of the +property should be the amount of that resource offered by the node. For +example: ```xml @@ -57,7 +163,9 @@ Similarly, a new configuration file `node­-resources.xml` will also be loaded b ``` -Node Manager will use these custom resource types and will register it's capability to Resource Manager. +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. Resource Profiles ----------------- @@ -87,30 +195,6 @@ Admin could specify `resource-profiles.json` which indicates various profiles su ``` This indicates that profile named "minimum", "default", "maximum" and "http" is supported. Clients could easily use this name instead of specifying each resource details. -Configurations -------------- - -*In `yarn-site.xml`* - -| Configuration Property | Description | -|:---- |:---- | -| `yarn.resourcemanager.resource-profiles.enabled` | *(Required)* In the server side it indicates whether resource profiles support is enabled or not. Defaults to `false`. | - -Please note that, `resource-types.xml` and `node­-resources.xml` file also need to be placed in conf directory if new resources are to be added to YARN. - -*In `resource-types.xml`* - -| Configuration Property | Value | Description | -|:---- |:---- |:---- | -| `yarn.resource-types` | resource1 | Custom resource | -| `yarn.resource-types.resource1.units` | G | Default unit for resource1 type | - -*In `node­-resources.xml`* - -| Configuration Property | Value | Description | -|:---- |:---- |:---- | -| `yarn.nodemanager.resource-type.resource1` | 5G | Resource capability for resource named 'resource1'. | - Use it -------- Distributed Shell is supporting this feature and user could specify a resource profile name which YARN is supporting while running a DS application.