Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 199E4184AD for ; Mon, 28 Mar 2016 10:32:58 +0000 (UTC) Received: (qmail 25068 invoked by uid 500); 28 Mar 2016 10:32:58 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 25032 invoked by uid 500); 28 Mar 2016 10:32:58 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 25015 invoked by uid 99); 28 Mar 2016 10:32:57 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Mar 2016 10:32:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C266CDFCDD; Mon, 28 Mar 2016 10:32:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dmitriusan@apache.org To: commits@ambari.apache.org Date: Mon, 28 Mar 2016 10:32:57 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer 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) 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 Authored: Mon Mar 28 13:32:00 2016 +0300 Committer: Lisnichenko Dmitro 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: