ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject ambari git commit: AMBARI-15557 YARN service check fails if there is no queue named "default" (dsen)
Date Thu, 24 Mar 2016 15:24:22 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 ad9fce8a8 -> a119ab4f8


AMBARI-15557 YARN service check fails if there is no queue named "default" (dsen)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a119ab4f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a119ab4f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a119ab4f

Branch: refs/heads/branch-2.2
Commit: a119ab4f8851821700caaac869eb261455cad33e
Parents: ad9fce8
Author: Dmytro Sen <dsen@apache.org>
Authored: Thu Mar 24 17:19:13 2016 +0200
Committer: Dmytro Sen <dsen@apache.org>
Committed: Thu Mar 24 17:24:12 2016 +0200

----------------------------------------------------------------------
 .../YARN/2.1.0.2.0/package/scripts/params_linux.py     |  4 ++++
 .../YARN/2.1.0.2.0/package/scripts/service_check.py    | 13 ++++++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a119ab4f/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
index 91fdb83..f5cb106 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
@@ -194,6 +194,10 @@ yarn_log_dir = format("{yarn_log_dir_prefix}/{yarn_user}")
 mapred_job_summary_log = format("{mapred_log_dir_prefix}/{mapred_user}/hadoop-mapreduce.jobsummary.log")
 yarn_job_summary_log = format("{yarn_log_dir_prefix}/{yarn_user}/hadoop-mapreduce.jobsummary.log")
 
+yarn_default_queue_name = "default"
+yarn_scheduler_capacity_root_queues = default("/configurations/capacity-scheduler/yarn.scheduler.capacity.root.queues",
yarn_default_queue_name)
+
+
 user_group = config['configurations']['cluster-env']['user_group']
 
 #exclude file

http://git-wip-us.apache.org/repos/asf/ambari/blob/a119ab4f/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
index a38fb85..0afdd26 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
@@ -29,6 +29,7 @@ from ambari_commons import os_utils
 from ambari_commons import OSConst
 from ambari_commons.os_family_impl import OsFamilyImpl
 from resource_management.libraries.functions.get_user_call_output import get_user_call_output
+from resource_management.core.logger import Logger
 
 CURL_CONNECTION_TIMEOUT = '5'
 
@@ -85,16 +86,26 @@ class ServiceCheckDefault(ServiceCheck):
     import params
     env.set_params(params)
 
+    queue_for_check = params.yarn_default_queue_name
+    yarn_queue_list = params.yarn_scheduler_capacity_root_queues.split(",")
+    yarn_queue_list = list(filter(lambda x: x.strip(), yarn_queue_list))
+
+    if params.yarn_default_queue_name not in yarn_queue_list and len(yarn_queue_list) >
0:
+      queue_for_check = yarn_queue_list[0]
+      Logger.logger.info("No '{0}' queue present, using '{1}' instead".format(params.yarn_default_queue_name,
queue_for_check))
+
     if params.hdp_stack_version_major != "" and compare_versions(params.hdp_stack_version_major,
'2.2') >= 0:
       path_to_distributed_shell_jar = "/usr/hdp/current/hadoop-yarn-client/hadoop-yarn-applications-distributedshell.jar"
     else:
       path_to_distributed_shell_jar = "/usr/lib/hadoop-yarn/hadoop-yarn-applications-distributedshell*.jar"
 
+
     yarn_distrubuted_shell_check_cmd = format("yarn org.apache.hadoop.yarn.applications.distributedshell.Client
"
                                               "-shell_command ls "
                                               "-num_containers {number_of_nm} "
                                               "-jar {path_to_distributed_shell_jar} "
-                                              "-timeout 300000")
+                                              "-timeout 300000"
+                                              "--queue {queue_for_check}")
 
     if params.security_enabled:
       kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser_principal};")


Mime
View raw message