You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2016/01/15 14:47:25 UTC
[2/2] ambari git commit: AMBARI-14686. YARN service check was failed
on cluster with enabled NN and Rm HAs (aonishuk)
AMBARI-14686. YARN service check was failed on cluster with enabled NN and Rm HAs (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/817fa84a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/817fa84a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/817fa84a
Branch: refs/heads/branch-2.2
Commit: 817fa84ae7129f009e03d2247a8986dac5c08b65
Parents: 27532c2
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Fri Jan 15 15:46:46 2016 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Fri Jan 15 15:46:46 2016 +0200
----------------------------------------------------------------------
.../YARN/2.1.0.2.0/package/scripts/params_linux.py | 17 +++++++++++++++++
.../2.1.0.2.0/package/scripts/service_check.py | 4 ++--
2 files changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/817fa84a/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 15ad4b4..a24b849 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
@@ -312,6 +312,23 @@ scheme = 'http' if not yarn_https_on else 'https'
yarn_rm_address = config['configurations']['yarn-site']['yarn.resourcemanager.webapp.address'] if not yarn_https_on else config['configurations']['yarn-site']['yarn.resourcemanager.webapp.https.address']
rm_active_port = rm_https_port if yarn_https_on else rm_port
+rm_ha_enabled = False
+rm_ha_ids_list = []
+rm_webapp_addresses_list = [yarn_rm_address]
+rm_ha_ids = default("/configurations/yarn-site/yarn.resourcemanager.ha.rm-ids", None)
+
+if rm_ha_ids:
+ rm_ha_ids_list = rm_ha_ids.split(",")
+ if len(rm_ha_ids_list) > 1:
+ rm_ha_enabled = True
+
+if rm_ha_enabled:
+ rm_webapp_addresses_list = []
+ for rm_id in rm_ha_ids_list:
+ rm_webapp_address_property = format('yarn.resourcemanager.webapp.address.{rm_id}') if not yarn_https_on else format('yarn.resourcemanager.webapp.https.address.{rm_id}')
+ rm_webapp_address = config['configurations']['yarn-site'][rm_webapp_address_property]
+ rm_webapp_addresses_list.append(rm_webapp_address)
+
#ranger yarn properties
if has_ranger_admin:
is_supported_yarn_ranger = config['configurations']['yarn-env']['is_supported_yarn_ranger']
http://git-wip-us.apache.org/repos/asf/ambari/blob/817fa84a/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 6aca8b2..cd4d558 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
@@ -114,8 +114,8 @@ class ServiceCheckDefault(ServiceCheck):
application_name = item
json_response_received = False
- for rm_host in params.rm_hosts:
- info_app_url = params.scheme + "://" + rm_host + ":" + params.rm_active_port + "/ws/v1/cluster/apps/" + application_name
+ for rm_webapp_address in params.rm_webapp_addresses_list:
+ info_app_url = params.scheme + "://" + rm_webapp_address + "/ws/v1/cluster/apps/" + application_name
get_app_info_cmd = "curl --negotiate -u : -ksL --connect-timeout " + CURL_CONNECTION_TIMEOUT + " " + info_app_url