ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmitriu...@apache.org
Subject [1/2] ambari git commit: AMBARI-15597. After enabling SSL for Resource Manager, getting a constant Ambari Alert: Connection failed to https://0.0.0.0:8044/ws/v1/node/info (No JSON object could be decoded) (dlysnichenko)
Date Mon, 28 Mar 2016 10:32:57 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 54e08eda9 -> af47269e9
  refs/heads/trunk c9f4bcc6c -> d0672c2ba


AMBARI-15597. After enabling SSL for Resource Manager, getting a constant Ambari Alert: Connection
failed to https://0.0.0.0:8044/ws/v1/node/info (No JSON object could be decoded) (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: d0672c2ba8d1f8a15ae58c6af62f62f7edc47466
Parents: c9f4bcc
Author: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Authored: Mon Mar 28 13:32:00 2016 +0300
Committer: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Committed: Mon Mar 28 13:32:00 2016 +0300

----------------------------------------------------------------------
 .../package/alerts/alert_nodemanager_health.py  | 32 +++++++++++---------
 1 file changed, 17 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d0672c2b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py
index 2105bed..d7159e4 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py
@@ -81,6 +81,9 @@ def execute(configurations={}, parameters={}, host_name=None):
   if configurations is None:
     return (result_code, ['There were no configurations supplied to the script.'])
 
+  if host_name is None:
+    host_name = socket.getfqdn()
+
   scheme = 'http'
   http_uri = None
   https_uri = None
@@ -123,32 +126,31 @@ def execute(configurations={}, parameters={}, host_name=None):
 
 
   # determine the right URI and whether to use SSL
-  uri = http_uri
+  host_port = http_uri
   if http_policy == 'HTTPS_ONLY':
     scheme = 'https'
 
     if https_uri is not None:
-      uri = https_uri
+      host_port = https_uri
 
   label = ''
   url_response = None
   node_healthy = 'false'
   total_time = 0
 
+  # replace hostname on host fqdn to make it work on all environments
+  if host_port is not None:
+    if ":" in host_port:
+      uri_host, uri_port = host_port.split(':')
+      host_port = '{0}:{1}'.format(host_name, uri_port)
+    else:
+      host_port = host_name
+
   # some yarn-site structures don't have the web ui address
-  if uri is None:
-    if host_name is None:
-      host_name = socket.getfqdn()
-
-    uri = '{0}:{1}'.format(host_name, NODEMANAGER_DEFAULT_PORT)
-    
-  if OSCheck.is_windows_family():
-    uri_host, uri_port = uri.split(':')
-    # on windows 0.0.0.0 is invalid address to connect but on linux it resolved to 127.0.0.1
-    uri_host = resolve_address(uri_host)
-    uri = '{0}:{1}'.format(uri_host, uri_port)
-
-  query = "{0}://{1}/ws/v1/node/info".format(scheme,uri)
+  if host_port is None:
+    host_port = '{0}:{1}'.format(host_name, NODEMANAGER_DEFAULT_PORT)
+
+  query = "{0}://{1}/ws/v1/node/info".format(scheme, host_port)
 
   try:
     if kerberos_principal is not None and kerberos_keytab is not None and security_enabled:


Mime
View raw message