Browse Source

AMBARI-10364. YARN: Node Label features (aonishuk)

Andrew Onishuk 10 years ago
parent
commit
6fd80a2325

+ 1 - 0
ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params.py

@@ -224,3 +224,4 @@ min_user_id = config['configurations']['yarn-env']['min_user_id']
 
 # Node labels
 node_labels_dir = default("/configurations/yarn-site/yarn.node-labels.fs-store.root-dir", None)
+node_label_enable = config['configurations']['yarn-site']['yarn.node-labels.enabled']

+ 1 - 1
ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py

@@ -144,7 +144,7 @@ def yarn(name = None):
        owner=params.yarn_user,
        group=params.user_group
     )
-    if params.node_labels_dir:
+    if not is_empty(params.node_label_enable) and params.node_label_enable or is_empty(params.node_label_enable) and params.node_labels_dir:
       params.HdfsDirectory(params.node_labels_dir,
                            action="create",
                            owner=params.yarn_user,

+ 37 - 0
ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/yarn-site.xml

@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+   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.
+-->
+
+<!-- Put site-specific property overrides in this file. -->
+
+<configuration supports_final="true" xmlns:xi="http://www.w3.org/2001/XInclude">
+
+  <property>
+    <name>yarn.node-labels.manager-class</name>
+    <value>org.apache.hadoop.yarn.server.resourcemanager.nodelabels.MemoryRMNodeLabelsManager</value>
+    <description>If user want to enable this feature, specify it to "org.apache.hadoop.yarn.server.resourcemanager.nodelabels.RMNodeLabelsManager</description>
+    <deleted>true</deleted>
+  </property>
+
+  <property>
+    <name>yarn.node-labels.enabled</name>
+    <value>false</value>
+    <description>Enable node labels</description>
+  </property>
+
+</configuration>

+ 1 - 0
ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/metainfo.xml

@@ -73,6 +73,7 @@
           </packages>
         </osSpecific>
       </osSpecifics>
+      <configuration-dir>configuration-mapred</configuration-dir>
     </service>
 
   </services>