Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 61388200D1A for ; Mon, 9 Oct 2017 23:55:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5FDCD160BE1; Mon, 9 Oct 2017 21:55:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 505D3160BE3 for ; Mon, 9 Oct 2017 23:55:13 +0200 (CEST) Received: (qmail 90016 invoked by uid 500); 9 Oct 2017 21:55:09 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 89552 invoked by uid 99); 9 Oct 2017 21:55:09 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Oct 2017 21:55:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A88E9DFF0F; Mon, 9 Oct 2017 21:55:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jhung@apache.org To: common-commits@hadoop.apache.org Date: Mon, 09 Oct 2017 21:55:16 -0000 Message-Id: <71bb68ffd48b476a89caa3f65a14ea9d@git.apache.org> In-Reply-To: <979135298be6458c9909824d79613393@git.apache.org> References: <979135298be6458c9909824d79613393@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [12/17] hadoop git commit: YARN-7238. Documentation for API based scheduler configuration management archived-at: Mon, 09 Oct 2017 21:55:14 -0000 YARN-7238. Documentation for API based scheduler configuration management Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/d35f5440 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/d35f5440 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/d35f5440 Branch: refs/heads/YARN-5734-branch-3.0 Commit: d35f54402026ce0ac2f307158003dab90b12958d Parents: 5105bc4 Author: Jonathan Hung Authored: Mon Sep 25 17:47:32 2017 -0700 Committer: Jonathan Hung Committed: Mon Oct 9 14:54:56 2017 -0700 ---------------------------------------------------------------------- .../src/site/markdown/CapacityScheduler.md | 24 ++- .../src/site/markdown/ResourceManagerRest.md | 186 +++++++++++++++++++ .../src/site/markdown/YarnCommands.md | 13 ++ 3 files changed, 221 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/d35f5440/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/CapacityScheduler.md ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/CapacityScheduler.md b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/CapacityScheduler.md index 6bb8489..d70f891 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/CapacityScheduler.md +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/CapacityScheduler.md @@ -295,9 +295,29 @@ The `ReservationSystem` is integrated with the `CapacityScheduler` queue hierach Changing Queue Configuration ---------------------------- -Changing queue properties and adding new queues is very simple. You need to edit **conf/capacity-scheduler.xml** and run *yarn rmadmin -refreshQueues*. +Changing queue/scheduler properties and adding/removing queues can be done in two ways, via file or via API. + +### Changing queue configuration via file + + To edit by file, you need to edit **conf/capacity-scheduler.xml** and run *yarn rmadmin -refreshQueues*. $ vi $HADOOP_CONF_DIR/capacity-scheduler.xml $ $HADOOP_YARN_HOME/bin/yarn rmadmin -refreshQueues -**Note:** Queues cannot be *deleted*, only addition of new queues is supported - the updated queue configuration should be a valid one i.e. queue-capacity at each *level* should be equal to 100%. +### Changing queue configuration via API + + Editing by API uses a backing store for the scheduler configuration. To enable this, the following parameters can be configured in yarn-site.xml. + + | Property | Description | + |:---- |:---- | + | `yarn.scheduler.capacity.configuration.provider` | The type of configuration provider to use for capacity scheduler. To enable changing queue configuration via API, this should be set to *store*. Default value is *file*, which disables the API and reverts back to changing queue configuration via file. | + | `yarn.scheduler.configuration.store.class` | The type of backing store to use. Default value is *memory*, which stores the scheduler configuration in memory (and does not persist configuration changes across restarts). Other values are *leveldb* (using a leveldb-based implementation), and *zk* (using a zookeeper-based implementation). | + | `yarn.scheduler.configuration.mutation.acl-policy.class` | An ACL policy can be configured to restrict which users can modify which queues. Default value is *org.apache.hadoop.yarn.server.resourcemanager.scheduler.DefaultConfigurationMutationACLPolicy*, which only allows YARN admins to make any configuration modifications. Another value is *org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.conf.QueueAdminConfigurationMutationACLPolicy*, which only allows queue modifications if the caller is an admin of the queue. | + | `yarn.scheduler.configuration.store.max-logs` | Configuration changes are audit logged in the backing store, if using leveldb or zookeeper. This configuration controls the maximum number of audit logs to store, dropping the oldest logs when exceeded. Default is 1000. | + | `yarn.scheduler.configuration.leveldb-store.path` | The storage path of the configuration store when using leveldb. Default value is *${hadoop.tmp.dir}/yarn/system/confstore*. | + | `yarn.scheduler.configuration.leveldb-store.compaction-interval-secs` | The interval for compacting the configuration store in seconds, when using leveldb. Default value is 86400, or one day. | + | `yarn.scheduler.configuration.zk-store.parent-path` | The zookeeper root node path for configuration store related information, when using zookeeper. Default value is */confstore*. | + + **Note:** When enabling backing store for scheduler configuration, *yarn rmadmin -refreshQueues* will be disabled, i.e. it will no longer be possible to update configuration via file. + + See the [YARN Resource Manager REST API](ResourceManagerRest.html#Scheduler_Configuration_Mutation_API) for examples on how to change scheduler configuration via REST, and [YARN Commands Reference](YarnCommands.html#schedconf) for examples on how to change scheduler configuration via command line. http://git-wip-us.apache.org/repos/asf/hadoop/blob/d35f5440/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/ResourceManagerRest.md ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/ResourceManagerRest.md b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/ResourceManagerRest.md index 82f80f3..025e9a7 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/ResourceManagerRest.md +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/ResourceManagerRest.md @@ -4430,3 +4430,189 @@ Response Body: 90 ``` + +Scheduler Configuration Mutation API +-------------------------------- + +The scheduler configuration mutation API provides a way to modify scheduler/queue configuration and queue hierarchy. + + +### URI + + * http://rm-http-address:port/ws/v1/cluster/sched-conf + +### HTTP Operations Supported + + * PUT + +### Elements of the *schedConf* object + +| Item | Data Type | Description | +|:---- |:---- |:---- | +| update-queue | object | A queue whose configurations should be updated | +| add-queue | object | A queue to add to the scheduler along with this queue's configurations | +| remove-queue | string | Full path name of a queue to remove | +| global-updates | map | Map of key value pairs to update scheduler's global configuration | + +### PUT Request Examples + +Put requests are used to modify the scheduler configuration. A successful mutation results in a 200 response. A malformed request or one which resulted in an invalid scheduler configuration results in a 400 response. + +**Updating queue configuration(s)** + +Request for updating queue configurations. + +*Elements of the* update-queue *object* + +| Item | Data Type | Description | +|:---- |:---- |:---- | +| queueName | string | Full path name of the queue to update | +| params | map | A map of key value configuration pairs to update for this queue | + +Assuming we are using the capacity scheduler and the current queue configuration is a single queue *root.default*, this example sets *root.default*'s maximum applications to 100 and its minimum user limit percent to 10. + +HTTP Request: + +```xml + Accept: application/xml + PUT http://rm-http-address:port/ws/v1/cluster/sched-conf + Content-Type: application/xml + + + + root.default + + + maximum-applications + 100 + + + minimum-user-limit-percent + 10 + + + + +``` + + +Response Header: + + HTTP/1.1 200 OK + Content-Type: application/xml + Transfer-Encoding: chunked + + +**Adding a queue** + +Request for adding queues/updating queue configurations. + +*Elements of the* add-queue *object* + +| Item | Data Type | Description | +|:---- |:---- |:---- | +| queueName | string | Full path name of the queue to add | +| params | map | A map of key value configuration pairs to set for this queue | + +Assuming we are using the capacity scheduler and the current queue configuration is a single queue *root.default*, this example adds a queue *root.a* with capacity/maximum-capacity 10, and adjusts *root.default*'s capacity/maximum-capacity to 90. (More complex examples include adding a queue whose parent is also being added in the same request, or adding multiple sibling queues.) + +HTTP Request: + +```xml + Accept: application/xml + PUT http://rm-http-address:port/ws/v1/cluster/sched-conf + Content-Type: application/xml + + + + root.a + + + capacity + 10 + + + maximum-capacity + 10 + + + + + root.default + + + capacity + 90 + + + maximum-capacity + 90 + + + + +``` + + +Response Header: + + HTTP/1.1 200 OK + Content-Type: application/xml + Transfer-Encoding: chunked + +**Removing queues** + +Request for removing queues from the queue hierarchy. + +Assuming we are using the capacity scheduler and the current queue configuration is three queues *root.default*, *root.a*, and *root.b*, this example removes both *root.a* and *root.b*. (More complex examples include removing a parent queue and its children.) + +**Note:** Queues must be put into `STOPPED` state before they are deleted. Any updated queue configuration should be a valid one i.e. queue-capacity at each *level* should be equal to 100%. + + +HTTP Request: + +```xml + Accept: application/xml + PUT http://rm-http-address:port/ws/v1/cluster/sched-conf + Content-Type: application/xml + + + root.a + root.b + +``` + + +Response Header: + + HTTP/1.1 200 OK + Content-Type: application/xml + Transfer-Encoding: chunked + +**Updating global scheduler configurations** + +Request for updating global scheduler configurations. Assuming we are using the capacity scheduler, this example enables queue mappings. For global configuration updates, the full configuration key must be specified. + +HTTP Request: + +```xml + Accept: application/xml + PUT http://rm-http-address:port/ws/v1/cluster/sched-conf + Content-Type: application/xml + + + + + yarn.scheduler.capacity.queue-mappings-override.enable + true + + + +``` + + +Response Header: + + HTTP/1.1 200 OK + Content-Type: application/xml + Transfer-Encoding: chunked http://git-wip-us.apache.org/repos/asf/hadoop/blob/d35f5440/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/YarnCommands.md ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/YarnCommands.md b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/YarnCommands.md index 5f430ec..2fc65bc 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/YarnCommands.md +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/markdown/YarnCommands.md @@ -237,6 +237,19 @@ Usage: Runs ResourceManager admin client +### schedconf + +Usage: `yarn schedconf [options]` + +| COMMAND\_OPTIONS | Description | +|:---- |:---- | +| -add | Semicolon separated values of queues to add and their queue configurations. This example adds queue "queuePath1" (a full path name), which has queue configurations key1=val1 and key2=val2. It also adds queue "queuePath2", which has queue configuration key3=val3. | +| -remove | Comma-separated queues to remove. This example removes queuePath1 and queuePath2 queues (full path names). **Note:** Queues must be put into `STOPPED` state before they are deleted. | +| -update | Semicolon separated values of queues whose configurations should be updated. This example sets key1=val1 and key2=val2 for queue configuration of queuePath1 (full path name), and sets key3=val3 for queue configuration of queuePath2. | +| -global | Update scheduler global configurations. This example sets key1=val1 and key2=val2 for scheduler's global configuration. | + +Updates scheduler configuration + ### scmadmin Usage: `yarn scmadmin [options] ` --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org