Explorar el Código

AMBARI-8123 Node labels need hdfs directory to be created as part of Ambari YARN install (dsen)

Dmytro Sen hace 10 años
padre
commit
b2116e173a

+ 2 - 0
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/package/scripts/params.py

@@ -174,3 +174,5 @@ mapred_local_dir = "/tmp/hadoop-mapred/mapred/local"
 hdfs_log_dir_prefix = config['configurations']['hadoop-env']['hdfs_log_dir_prefix']
 hdfs_log_dir_prefix = config['configurations']['hadoop-env']['hdfs_log_dir_prefix']
 min_user_id = config['configurations']['yarn-env']['min_user_id']
 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)

+ 0 - 1
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/package/scripts/resourcemanager.py

@@ -29,7 +29,6 @@ from service import service
 class Resourcemanager(Script):
 class Resourcemanager(Script):
   def install(self, env):
   def install(self, env):
     self.install_packages(env)
     self.install_packages(env)
-    self.configure(env)
 
 
   def configure(self, env):
   def configure(self, env):
     import params
     import params

+ 7 - 0
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/package/scripts/yarn.py

@@ -125,6 +125,13 @@ def yarn(name = None):
        owner=params.yarn_user,
        owner=params.yarn_user,
        group=params.user_group
        group=params.user_group
     )
     )
+    if params.node_labels_dir:
+      params.HdfsDirectory(params.node_labels_dir,
+                           action="create",
+                           owner=params.yarn_user,
+                           group=params.user_group,
+                           mode=0700
+      )
   elif name == 'apptimelineserver':
   elif name == 'apptimelineserver':
     Directory(params.ats_leveldb_dir,
     Directory(params.ats_leveldb_dir,
        owner=params.yarn_user,
        owner=params.yarn_user,

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

@@ -286,4 +286,9 @@
     <value>0.0.0.0</value>
     <value>0.0.0.0</value>
     <description>Default value is 0.0.0.0, when this is set the service will bind on all interfaces.  I think these two options (blank, "0.0.0.0" sans quotes) should be the two available values, with blank as the default.</description>
     <description>Default value is 0.0.0.0, when this is set the service will bind on all interfaces.  I think these two options (blank, "0.0.0.0" sans quotes) should be the two available values, with blank as the default.</description>
   </property>
   </property>
+  <property>
+    <name>yarn.node-labels.fs-store.root-dir</name>
+    <value>/system/yarn/node-labels</value>
+    <description></description>
+  </property>
 </configuration>
 </configuration>