You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ds...@apache.org on 2016/09/08 11:54:06 UTC

ambari git commit: AMBARI-18199 Wrong hostname in timeline.metrics.service.webapp.address breaks AMS HA (dsen)

Repository: ambari
Updated Branches:
  refs/heads/trunk 6180afee4 -> c1bfc6dd6


AMBARI-18199 Wrong hostname in timeline.metrics.service.webapp.address breaks AMS HA (dsen)


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

Branch: refs/heads/trunk
Commit: c1bfc6dd64acc64c9ddc839b39b0a89d0a871bb1
Parents: 6180afe
Author: Dmytro Sen <ds...@apache.org>
Authored: Thu Sep 8 14:53:52 2016 +0300
Committer: Dmytro Sen <ds...@apache.org>
Committed: Thu Sep 8 14:53:52 2016 +0300

----------------------------------------------------------------------
 .../src/test/python/ambari_agent/TestAlerts.py  |  2 +-
 .../ambari_commons/ambari_metrics_helper.py     | 56 ++++++++++++++++++++
 .../BlueprintConfigurationProcessor.java        | 13 ++---
 .../1.6.1.2.2.0/package/scripts/params.py       |  5 +-
 .../0.1.0/configuration/ams-site.xml            |  2 +-
 .../0.1.0/package/scripts/params.py             |  5 +-
 .../FLUME/1.4.0.2.0/package/scripts/params.py   |  5 +-
 .../0.96.0.2.0/package/scripts/params_linux.py  |  5 +-
 .../package/alerts/alert_metrics_deviation.py   |  4 +-
 .../0.12.0.2.0/package/scripts/params_linux.py  |  5 +-
 .../KAFKA/0.8.1/package/scripts/params.py       |  8 +--
 .../STORM/0.9.1/package/scripts/params_linux.py |  5 +-
 .../2.0.6/hooks/before-START/scripts/params.py  |  7 +--
 .../stacks/HDP/2.0.6/services/stack_advisor.py  |  3 +-
 .../2.1/hooks/before-START/scripts/params.py    |  6 ++-
 .../BlueprintConfigurationProcessorTest.java    |  6 +--
 .../2.0.6/HDFS/test_alert_metrics_deviation.py  |  5 +-
 .../python/stacks/2.0.6/configs/default.json    |  2 +-
 .../2.0.6/configs/default_ams_embedded.json     |  2 +-
 .../2.0.6/configs/default_hive_non_hdfs.json    |  2 +-
 .../2.0.6/configs/default_with_bucket.json      |  2 +-
 .../stacks/2.2/common/test_stack_advisor.py     |  2 +-
 .../journalnode-upgrade-hdfs-secure.json        |  4 +-
 .../stacks/2.2/configs/journalnode-upgrade.json |  4 +-
 .../2.2/configs/ranger-admin-upgrade.json       |  4 +-
 .../2.2/configs/ranger-usersync-upgrade.json    |  4 +-
 .../test/python/stacks/2.3/configs/ats_1_5.json |  2 +-
 .../python/stacks/2.5/configs/hsi_default.json  |  2 +-
 .../slider/SliderAppsViewControllerImpl.java    |  1 +
 29 files changed, 111 insertions(+), 62 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-agent/src/test/python/ambari_agent/TestAlerts.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/ambari_agent/TestAlerts.py b/ambari-agent/src/test/python/ambari_agent/TestAlerts.py
index e114daa..2bddc43 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestAlerts.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestAlerts.py
@@ -411,7 +411,7 @@ class TestAlerts(TestCase):
   def test_ams_alert(self, ma_load_metric_mock):
     definition_json = self._get_ams_alert_definition()
     configuration = {'ams-site':
-      {'timeline.metrics.service.webapp.address': 'c6401.ambari.apache.org:6188'}
+      {'timeline.metrics.service.webapp.address': '0.0.0.0:6188'}
     }
 
     collector = AlertCollector()

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-common/src/main/python/ambari_commons/ambari_metrics_helper.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/ambari_commons/ambari_metrics_helper.py b/ambari-common/src/main/python/ambari_commons/ambari_metrics_helper.py
new file mode 100644
index 0000000..7b4e8f5
--- /dev/null
+++ b/ambari-common/src/main/python/ambari_commons/ambari_metrics_helper.py
@@ -0,0 +1,56 @@
+#!/usr/bin/env python
+
+'''
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+'''
+
+import os
+import random
+from resource_management.libraries.functions import conf_select
+
+DEFAULT_COLLECTOR_SUFFIX = '.sink.timeline.collector'
+DEFAULT_METRICS2_PROPERTIES_FILE_NAME = 'hadoop-metrics2.properties'
+
+def select_metric_collector_for_sink(sink_name):
+    # TODO check '*' sink_name
+
+    all_collectors_string = get_metric_collectors_from_properties_file(sink_name)
+    all_collectors_list = all_collectors_string.split(',')
+    return select_metric_collector_hosts_from_hostnames(all_collectors_list)
+
+def select_metric_collector_hosts_from_hostnames(hosts):
+    return random.choice(hosts)
+
+def get_metric_collectors_from_properties_file(sink_name):
+    hadoop_conf_dir = conf_select.get_hadoop_conf_dir()
+    props = load_properties_from_file(os.path.join(hadoop_conf_dir, DEFAULT_METRICS2_PROPERTIES_FILE_NAME))
+    return props.get(sink_name + DEFAULT_COLLECTOR_SUFFIX)
+
+def load_properties_from_file(filepath, sep='=', comment_char='#'):
+    """
+    Read the file passed as parameter as a properties file.
+    """
+    props = {}
+    with open(filepath, "rt") as f:
+        for line in f:
+            l = line.strip()
+            if l and not l.startswith(comment_char):
+                key_value = l.split(sep)
+                key = key_value[0].strip()
+                value = sep.join(key_value[1:]).strip('" \t')
+                props[key] = value
+    return props
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
index 822c1a4..ba09368 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
@@ -2689,17 +2689,10 @@ public class BlueprintConfigurationProcessor {
     amsSiteMap.put("timeline.metrics.service.webapp.address", new SingleHostTopologyUpdater("METRICS_COLLECTOR") {
       @Override
       public String updateForClusterCreate(String propertyName, String origValue, Map<String, Map<String, String>> properties, ClusterTopology topology) {
-        int metricsCollectorsCount = topology.getHostAssignmentsForComponent("METRICS_COLLECTOR").size();
-        if (metricsCollectorsCount == 1) {
-          String value = origValue;
-          //localhost will be replaced with real hostname in updateForClusterCreate()
-          if (isSpecialNetworkAddress(origValue)) {
-            value = origValue.replace(BIND_ALL_IP_ADDRESS, "localhost");
-          }
-          return super.updateForClusterCreate(propertyName, value, properties, topology);
+        if (!origValue.startsWith(BIND_ALL_IP_ADDRESS)) {
+          return origValue.replace(origValue.split(":")[0], BIND_ALL_IP_ADDRESS);
         } else {
-          //For multiple collectors
-          return origValue.replace("localhost", BIND_ALL_IP_ADDRESS);
+          return origValue;
         }
       }
     });

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/params.py
index 7352f33..4c111f1 100644
--- a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/params.py
@@ -28,6 +28,7 @@ from resource_management.libraries.functions.get_bare_principal import get_bare_
 from resource_management.libraries.script.script import Script
 from resource_management.libraries.functions.stack_features import check_stack_feature
 from resource_management.libraries.functions import StackFeature
+from ambari_commons.ambari_metrics_helper import select_metric_collector_hosts_from_hostnames
 
 import status_params
 
@@ -128,12 +129,12 @@ if has_metric_collector:
       'metrics_collector_vip_host' in config['configurations']['cluster-env']:
     metric_collector_host = config['configurations']['cluster-env']['metrics_collector_vip_host']
   else:
-    metric_collector_host = ams_collector_hosts[0]
+    metric_collector_host = select_metric_collector_hosts_from_hostnames(ams_collector_hosts)
   if 'cluster-env' in config['configurations'] and \
       'metrics_collector_vip_port' in config['configurations']['cluster-env']:
     metric_collector_port = config['configurations']['cluster-env']['metrics_collector_vip_port']
   else:
-    metric_collector_web_address = default("/configurations/ams-site/timeline.metrics.service.webapp.address", "localhost:6188")
+    metric_collector_web_address = default("/configurations/ams-site/timeline.metrics.service.webapp.address", "0.0.0.0:6188")
     if metric_collector_web_address.find(':') != -1:
       metric_collector_port = metric_collector_web_address.split(':')[1]
     else:

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-site.xml b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-site.xml
index c02df71..9b5c864 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-site.xml
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-site.xml
@@ -34,7 +34,7 @@
   </property>
   <property>
     <name>timeline.metrics.service.webapp.address</name>
-    <value>localhost:6188</value>
+    <value>0.0.0.0:6188</value>
     <description>
       The address of the metrics service web application.
     </description>

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
index fc95aa7..459ce45 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
@@ -30,6 +30,7 @@ from resource_management.libraries.functions.default import default
 from resource_management.libraries.functions.format import format
 from resource_management.libraries.functions.substitute_vars import substitute_vars
 from resource_management.libraries.resources.hdfs_resource import HdfsResource
+from ambari_commons.ambari_metrics_helper import select_metric_collector_hosts_from_hostnames
 import status_params
 from ambari_commons import OSCheck
 import ConfigParser
@@ -116,12 +117,12 @@ if 'cluster-env' in config['configurations'] and \
     'metrics_collector_vip_host' in config['configurations']['cluster-env']:
   metric_collector_host = config['configurations']['cluster-env']['metrics_collector_vip_host']
 else:
-  metric_collector_host = ams_collector_hosts[0]
+  metric_collector_host = select_metric_collector_hosts_from_hostnames(ams_collector_hosts)
 if 'cluster-env' in config['configurations'] and \
     'metrics_collector_vip_port' in config['configurations']['cluster-env']:
   metric_collector_port = config['configurations']['cluster-env']['metrics_collector_vip_port']
 else:
-  metric_collector_web_address = default("/configurations/ams-site/timeline.metrics.service.webapp.address", "localhost:6188")
+  metric_collector_web_address = default("/configurations/ams-site/timeline.metrics.service.webapp.address", "0.0.0.0:6188")
   if metric_collector_web_address.find(':') != -1:
     metric_collector_port = metric_collector_web_address.split(':')[1]
   else:

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/params.py
index fe00140..d3a9294 100644
--- a/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/params.py
@@ -22,6 +22,7 @@ from resource_management.libraries.functions import format
 from resource_management.libraries.functions.version import format_stack_version
 from resource_management.libraries.functions.default import default
 from resource_management.libraries.script.script import Script
+from ambari_commons.ambari_metrics_helper import select_metric_collector_hosts_from_hostnames
 
 if OSCheck.is_windows_family():
   from params_windows import *
@@ -93,12 +94,12 @@ if has_metric_collector:
       'metrics_collector_vip_host' in config['configurations']['cluster-env']:
     metric_collector_host = config['configurations']['cluster-env']['metrics_collector_vip_host']
   else:
-    metric_collector_host = ams_collector_hosts[0]
+    metric_collector_host = select_metric_collector_hosts_from_hostnames(ams_collector_hosts)
   if 'cluster-env' in config['configurations'] and \
       'metrics_collector_vip_port' in config['configurations']['cluster-env']:
     metric_collector_port = config['configurations']['cluster-env']['metrics_collector_vip_port']
   else:
-    metric_collector_web_address = default("/configurations/ams-site/timeline.metrics.service.webapp.address", "localhost:6188")
+    metric_collector_web_address = default("/configurations/ams-site/timeline.metrics.service.webapp.address", "0.0.0.0:6188")
     if metric_collector_web_address.find(':') != -1:
       metric_collector_port = metric_collector_web_address.split(':')[1]
     else:

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
index f3643b1..49b684b 100644
--- a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
@@ -40,6 +40,7 @@ from resource_management.libraries.functions import get_unique_id_and_date
 from resource_management.libraries.functions.get_not_managed_resources import get_not_managed_resources
 from resource_management.libraries.script.script import Script
 from resource_management.libraries.functions.expect import expect
+from ambari_commons.ambari_metrics_helper import select_metric_collector_hosts_from_hostnames
 
 # server configurations
 config = Script.get_config()
@@ -157,12 +158,12 @@ if has_metric_collector:
       'metrics_collector_vip_host' in config['configurations']['cluster-env']:
     metric_collector_host = config['configurations']['cluster-env']['metrics_collector_vip_host']
   else:
-    metric_collector_host = ams_collector_hosts[0]
+    metric_collector_host = select_metric_collector_hosts_from_hostnames(ams_collector_hosts)
   if 'cluster-env' in config['configurations'] and \
       'metrics_collector_vip_port' in config['configurations']['cluster-env']:
     metric_collector_port = config['configurations']['cluster-env']['metrics_collector_vip_port']
   else:
-    metric_collector_web_address = default("/configurations/ams-site/timeline.metrics.service.webapp.address", "localhost:6188")
+    metric_collector_web_address = default("/configurations/ams-site/timeline.metrics.service.webapp.address", "0.0.0.0:6188")
     if metric_collector_web_address.find(':') != -1:
       metric_collector_port = metric_collector_web_address.split(':')[1]
     else:

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_metrics_deviation.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_metrics_deviation.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_metrics_deviation.py
index f0a1d5c..4efdae5 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_metrics_deviation.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_metrics_deviation.py
@@ -31,6 +31,7 @@ from ambari_commons.aggregate_functions import sample_standard_deviation, mean
 from resource_management.libraries.functions.curl_krb_request import curl_krb_request
 from resource_management.libraries.functions.curl_krb_request import DEFAULT_KERBEROS_KINIT_TIMER_MS
 from resource_management.libraries.functions.curl_krb_request import KERBEROS_KINIT_TIMER_PARAMETER
+from ambari_commons.ambari_metrics_helper import select_metric_collector_for_sink
 
 
 RESULT_STATE_OK = 'OK'
@@ -177,7 +178,7 @@ def execute(configurations={}, parameters={}, host_name=None):
     else:
       collector_webapp_address = configurations[METRICS_COLLECTOR_WEBAPP_ADDRESS_KEY].split(":")
       if valid_collector_webapp_address(collector_webapp_address):
-        collector_host = collector_webapp_address[0]
+        collector_host = select_metric_collector_for_sink(app_id.lower()).split(":")[0]
         collector_port = int(collector_webapp_address[1])
       else:
         return (RESULT_STATE_UNKNOWN, ['{0} value should be set as "fqdn_hostname:port", but set to {1}'.format(
@@ -404,7 +405,6 @@ def execute(configurations={}, parameters={}, host_name=None):
 def valid_collector_webapp_address(webapp_address):
   if len(webapp_address) == 2 \
     and webapp_address[0] != '127.0.0.1' \
-    and webapp_address[0] != '0.0.0.0' \
     and webapp_address[1].isdigit():
     return True
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
index 1c8a86c..56e3ce6 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
@@ -42,6 +42,7 @@ from resource_management.libraries.functions.get_port_from_url import get_port_f
 from resource_management.libraries.functions.expect import expect
 from resource_management.libraries import functions
 from resource_management.libraries.functions.setup_atlas_hook import has_atlas_in_cluster
+from ambari_commons.ambari_metrics_helper import select_metric_collector_hosts_from_hostnames
 
 # Default log4j version; put config files under /etc/hive/conf
 log4j_version = '1'
@@ -495,12 +496,12 @@ if has_metric_collector:
       'metrics_collector_vip_host' in config['configurations']['cluster-env']:
     metric_collector_host = config['configurations']['cluster-env']['metrics_collector_vip_host']
   else:
-    metric_collector_host = ams_collector_hosts[0]
+    metric_collector_host = select_metric_collector_hosts_from_hostnames(ams_collector_hosts)
   if 'cluster-env' in config['configurations'] and \
       'metrics_collector_vip_port' in config['configurations']['cluster-env']:
     metric_collector_port = config['configurations']['cluster-env']['metrics_collector_vip_port']
   else:
-    metric_collector_web_address = default("/configurations/ams-site/timeline.metrics.service.webapp.address", "localhost:6188")
+    metric_collector_web_address = default("/configurations/ams-site/timeline.metrics.service.webapp.address", "0.0.0.0:6188")
     if metric_collector_web_address.find(':') != -1:
       metric_collector_port = metric_collector_web_address.split(':')[1]
     else:

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/params.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/params.py
index d5451b2..f631ac9 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/params.py
@@ -113,7 +113,6 @@ if 'ganglia_server_host' in config['clusterHostInfo'] and \
 else:
   ganglia_installed = False
 
-metric_collector_host = ""
 metric_collector_port = ""
 metric_collector_protocol = ""
 metric_truststore_path= default("/configurations/ams-ssl-client/ssl.client.truststore.location", "")
@@ -125,15 +124,10 @@ has_metric_collector = not len(ams_collector_hosts) == 0
 
 if has_metric_collector:
   if 'cluster-env' in config['configurations'] and \
-      'metrics_collector_vip_host' in config['configurations']['cluster-env']:
-    metric_collector_host = config['configurations']['cluster-env']['metrics_collector_vip_host']
-  else:
-    metric_collector_host = ams_collector_hosts[0]
-  if 'cluster-env' in config['configurations'] and \
       'metrics_collector_vip_port' in config['configurations']['cluster-env']:
     metric_collector_port = config['configurations']['cluster-env']['metrics_collector_vip_port']
   else:
-    metric_collector_web_address = default("/configurations/ams-site/timeline.metrics.service.webapp.address", "localhost:6188")
+    metric_collector_web_address = default("/configurations/ams-site/timeline.metrics.service.webapp.address", "0.0.0.0:6188")
     if metric_collector_web_address.find(':') != -1:
       metric_collector_port = metric_collector_web_address.split(':')[1]
     else:

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/params_linux.py
index d0ac3a4..f96aeeb 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/params_linux.py
@@ -40,6 +40,7 @@ from resource_management.libraries.functions import StackFeature
 from resource_management.libraries.functions.expect import expect
 from resource_management.libraries.functions.setup_atlas_hook import has_atlas_in_cluster
 from resource_management.libraries.functions import is_empty
+from ambari_commons.ambari_metrics_helper import select_metric_collector_hosts_from_hostnames
 
 # server configurations
 config = Script.get_config()
@@ -177,12 +178,12 @@ if has_metric_collector:
       'metrics_collector_vip_host' in config['configurations']['cluster-env']:
     metric_collector_host = config['configurations']['cluster-env']['metrics_collector_vip_host']
   else:
-    metric_collector_host = ams_collector_hosts[0]
+    metric_collector_host = select_metric_collector_hosts_from_hostnames(ams_collector_hosts)
   if 'cluster-env' in config['configurations'] and \
       'metrics_collector_vip_port' in config['configurations']['cluster-env']:
     metric_collector_port = config['configurations']['cluster-env']['metrics_collector_vip_port']
   else:
-    metric_collector_web_address = default("/configurations/ams-site/timeline.metrics.service.webapp.address", "localhost:6188")
+    metric_collector_web_address = default("/configurations/ams-site/timeline.metrics.service.webapp.address", "0.0.0.0:6188")
     if metric_collector_web_address.find(':') != -1:
       metric_collector_port = metric_collector_web_address.split(':')[1]
     else:

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py
index 699c51f..49a14d0 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py
@@ -113,15 +113,10 @@ if has_ganglia_server:
 metric_collector_port = None
 if has_metric_collector:
   if 'cluster-env' in config['configurations'] and \
-      'metrics_collector_vip_host' in config['configurations']['cluster-env']:
-    metric_collector_host = config['configurations']['cluster-env']['metrics_collector_vip_host']
-  else:
-    metric_collector_host = ams_collector_hosts[0]
-  if 'cluster-env' in config['configurations'] and \
       'metrics_collector_vip_port' in config['configurations']['cluster-env']:
     metric_collector_port = config['configurations']['cluster-env']['metrics_collector_vip_port']
   else:
-    metric_collector_web_address = default("/configurations/ams-site/timeline.metrics.service.webapp.address", "localhost:6188")
+    metric_collector_web_address = default("/configurations/ams-site/timeline.metrics.service.webapp.address", "0.0.0.0:6188")
     if metric_collector_web_address.find(':') != -1:
       metric_collector_port = metric_collector_web_address.split(':')[1]
     else:

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
index 7aeda19..fd0dfed 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
@@ -584,7 +584,8 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
         'metrics_collector_vip_host' in services['configurations']['cluster-env']['properties']:
       metric_collector_host = services['configurations']['cluster-env']['properties']['metrics_collector_vip_host']
     else:
-      metric_collector_host = 'localhost' if len(amsCollectorHosts) == 0 else amsCollectorHosts[0]
+      # TODO set "timeline.metrics.service.webapp.address" to 0.0.0.0:port in upgrade catalog
+      metric_collector_host = '0.0.0.0'
 
     putAmsSiteProperty("timeline.metrics.service.webapp.address", str(metric_collector_host) + ":6188")
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/main/resources/stacks/HDPWIN/2.1/hooks/before-START/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDPWIN/2.1/hooks/before-START/scripts/params.py b/ambari-server/src/main/resources/stacks/HDPWIN/2.1/hooks/before-START/scripts/params.py
index 5bd2a9e..7cd9340 100644
--- a/ambari-server/src/main/resources/stacks/HDPWIN/2.1/hooks/before-START/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDPWIN/2.1/hooks/before-START/scripts/params.py
@@ -19,6 +19,8 @@ limitations under the License.
 
 from resource_management import *
 import nturl2path
+from ambari_commons.ambari_metrics_helper import select_metric_collector_hosts_from_hostnames
+
 config = Script.get_config()
 ams_collector_hosts = default("/clusterHostInfo/metrics_collector_hosts", [])
 has_metric_collector = not len(ams_collector_hosts) == 0
@@ -27,12 +29,12 @@ if has_metric_collector:
       'metrics_collector_vip_host' in config['configurations']['cluster-env']:
     metric_collector_host = config['configurations']['cluster-env']['metrics_collector_vip_host']
   else:
-    metric_collector_host = ams_collector_hosts[0]
+    metric_collector_host = select_metric_collector_hosts_from_hostnames(ams_collector_hosts)
   if 'cluster-env' in config['configurations'] and \
       'metrics_collector_vip_port' in config['configurations']['cluster-env']:
     metric_collector_port = config['configurations']['cluster-env']['metrics_collector_vip_port']
   else:
-    metric_collector_web_address = default("/configurations/ams-site/timeline.metrics.service.webapp.address", "localhost:6188")
+    metric_collector_web_address = default("/configurations/ams-site/timeline.metrics.service.webapp.address", "0.0.0.0:6188")
     if metric_collector_web_address.find(':') != -1:
       metric_collector_port = metric_collector_web_address.split(':')[1]
     else:

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
index 950ade5..8a56da3 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
@@ -7733,7 +7733,7 @@ public class BlueprintConfigurationProcessorTest {
 
     configProcessor.doUpdateForClusterCreate();
 
-    assertEquals("host1:6188",
+    assertEquals("0.0.0.0:6188",
       clusterConfig.getPropertyValue("ams-site", "timeline.metrics.service.webapp.address"));
   }
 
@@ -7763,7 +7763,7 @@ public class BlueprintConfigurationProcessorTest {
 
     configProcessor.doUpdateForClusterCreate();
 
-    assertEquals("host1:6188",
+    assertEquals("0.0.0.0:6188",
       clusterConfig.getPropertyValue("ams-site", "timeline.metrics.service.webapp.address"));
   }
 
@@ -7773,7 +7773,7 @@ public class BlueprintConfigurationProcessorTest {
 
     Map<String, String> amsSite = new HashMap<String, String>();
     //default
-    amsSite.put("timeline.metrics.service.webapp.address", "localhost:6188");
+    amsSite.put("timeline.metrics.service.webapp.address", "0.0.0.0:6188");
     properties.put("ams-site", amsSite);
 
     Map<String, Map<String, String>> parentProperties = new HashMap<String, Map<String, String>>();

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_alert_metrics_deviation.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_alert_metrics_deviation.py b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_alert_metrics_deviation.py
index 5bfbfc6..1e35e6f 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_alert_metrics_deviation.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_alert_metrics_deviation.py
@@ -21,7 +21,7 @@ limitations under the License.
 # System imports
 import os
 import sys
-
+from ambari_commons import ambari_metrics_helper
 from mock.mock import patch, MagicMock
 
 # Local imports
@@ -74,12 +74,13 @@ class TestAlertMetricsDeviation(RMFTestCase):
     self.assertTrue(messages is not None and len(messages) == 1)
     self.assertTrue('is a required parameter for the script' in messages[0])
 
+  @patch.object(ambari_metrics_helper, 'get_metric_collectors_from_properties_file', new = MagicMock(return_value='c6401.ambari.apache.org:6188'))
   @patch("httplib.HTTPConnection")
   def test_alert(self, conn_mock):
     configs = {
       '{{hdfs-site/dfs.namenode.https-address}}': 'c6401.ambari.apache.org:50470',
       '{{hdfs-site/dfs.http.policy}}': 'HTTP_ONLY',
-      '{{ams-site/timeline.metrics.service.webapp.address}}': 'c6401.ambari.apache.org:6188',
+      '{{ams-site/timeline.metrics.service.webapp.address}}': '0.0.0.0:6188',
       '{{hdfs-site/dfs.namenode.http-address}}': 'c6401.ambari.apache.org:50070',
       '{{cluster-env/security_enabled}}': 'false',
       '{{cluster-env/smokeuser}}': 'ambari-qa',

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/default.json b/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
index f256216..24493c9 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
@@ -898,7 +898,7 @@
             "timeline.metrics.host.aggregator.ttl": "86400",
             "timeline.metrics.cluster.aggregator.hourly.checkpointCutOffMultiplier": "2",
             "timeline.metrics.service.cluster.aggregator.appIds": "datanode,nodemanager,hbase",
-            "timeline.metrics.service.webapp.address": "localhost:6188",
+            "timeline.metrics.service.webapp.address": "0.0.0.0:6188",
             "timeline.metrics.cluster.aggregator.hourly.disabled": "false",
             "timeline.metrics.aggregator.checkpoint.dir": "/var/lib/ambari-metrics-collector/checkpoint",
             "timeline.metrics.hbase.data.block.encoding": "FAST_DIFF",

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/test/python/stacks/2.0.6/configs/default_ams_embedded.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/default_ams_embedded.json b/ambari-server/src/test/python/stacks/2.0.6/configs/default_ams_embedded.json
index 100fefe..13dce2b 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/default_ams_embedded.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/default_ams_embedded.json
@@ -837,7 +837,7 @@
             "timeline.metrics.host.aggregator.ttl": "86400",
             "timeline.metrics.cluster.aggregator.hourly.checkpointCutOffMultiplier": "2",
             "timeline.metrics.service.cluster.aggregator.appIds": "datanode,nodemanager,hbase",
-            "timeline.metrics.service.webapp.address": "localhost:6188",
+            "timeline.metrics.service.webapp.address": "0.0.0.0:6188",
             "timeline.metrics.cluster.aggregator.hourly.disabled": "false",
             "timeline.metrics.aggregator.checkpoint.dir": "/var/lib/ambari-metrics-collector/checkpoint",
             "timeline.metrics.hbase.data.block.encoding": "FAST_DIFF",

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/test/python/stacks/2.0.6/configs/default_hive_non_hdfs.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/default_hive_non_hdfs.json b/ambari-server/src/test/python/stacks/2.0.6/configs/default_hive_non_hdfs.json
index c2688d0..d49868f 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/default_hive_non_hdfs.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/default_hive_non_hdfs.json
@@ -874,7 +874,7 @@
             "timeline.metrics.host.aggregator.ttl": "86400",
             "timeline.metrics.cluster.aggregator.hourly.checkpointCutOffMultiplier": "2",
             "timeline.metrics.service.cluster.aggregator.appIds": "datanode,nodemanager,hbase",
-            "timeline.metrics.service.webapp.address": "localhost:6188",
+            "timeline.metrics.service.webapp.address": "0.0.0.0:6188",
             "timeline.metrics.cluster.aggregator.hourly.disabled": "false",
             "timeline.metrics.aggregator.checkpoint.dir": "/var/lib/ambari-metrics-collector/checkpoint",
             "timeline.metrics.hbase.data.block.encoding": "FAST_DIFF",

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/test/python/stacks/2.0.6/configs/default_with_bucket.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/default_with_bucket.json b/ambari-server/src/test/python/stacks/2.0.6/configs/default_with_bucket.json
index aab07f0..a0e7e9d 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/default_with_bucket.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/default_with_bucket.json
@@ -889,7 +889,7 @@
             "timeline.metrics.host.aggregator.ttl": "86400",
             "timeline.metrics.cluster.aggregator.hourly.checkpointCutOffMultiplier": "2",
             "timeline.metrics.service.cluster.aggregator.appIds": "datanode,nodemanager,hbase",
-            "timeline.metrics.service.webapp.address": "localhost:6188",
+            "timeline.metrics.service.webapp.address": "0.0.0.0:6188",
             "timeline.metrics.cluster.aggregator.hourly.disabled": "false",
             "timeline.metrics.aggregator.checkpoint.dir": "/var/lib/ambari-metrics-collector/checkpoint",
             "timeline.metrics.hbase.data.block.encoding": "FAST_DIFF",

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
index 081a66a..3cd05d3 100644
--- a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
@@ -2293,7 +2293,7 @@ class TestHDP22StackAdvisor(TestCase):
           "timeline.metrics.cluster.aggregate.splitpoints": "master.FileSystem.MetaHlogSplitTime_75th_percentile",
           "timeline.metrics.host.aggregate.splitpoints": "master.FileSystem.MetaHlogSplitTime_75th_percentile",
           "timeline.metrics.service.handler.thread.count": "20",
-          'timeline.metrics.service.webapp.address': 'host1:6188',
+          'timeline.metrics.service.webapp.address': '0.0.0.0:6188',
           'timeline.metrics.service.watcher.disabled': 'false',
           'timeline.metrics.cache.size': '100',
           'timeline.metrics.cache.commit.interval': '10'

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/test/python/stacks/2.2/configs/journalnode-upgrade-hdfs-secure.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/configs/journalnode-upgrade-hdfs-secure.json b/ambari-server/src/test/python/stacks/2.2/configs/journalnode-upgrade-hdfs-secure.json
index 6b09d33..42ee4ed 100644
--- a/ambari-server/src/test/python/stacks/2.2/configs/journalnode-upgrade-hdfs-secure.json
+++ b/ambari-server/src/test/python/stacks/2.2/configs/journalnode-upgrade-hdfs-secure.json
@@ -316,7 +316,7 @@
             "timeline.metrics.cluster.aggregator.hourly.interval": "3600", 
             "timeline.metrics.host.aggregator.ttl": "86400", 
             "timeline.metrics.cluster.aggregator.hourly.checkpointCutOffMultiplier": "2", 
-            "timeline.metrics.service.webapp.address": "localhost:6188",
+            "timeline.metrics.service.webapp.address": "0.0.0.0:6188",
             "timeline.metrics.aggregator.checkpoint.dir": "/var/lib/ambari-metrics-collector/checkpoint", 
             "timeline.metrics.host.aggregator.minute.disabled": "false", 
             "timeline.metrics.cluster.aggregator.minute.ttl": "2592000", 
@@ -1268,4 +1268,4 @@
             "c6406.ambari.apache.org"
         ]
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/test/python/stacks/2.2/configs/journalnode-upgrade.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/configs/journalnode-upgrade.json b/ambari-server/src/test/python/stacks/2.2/configs/journalnode-upgrade.json
index e51e68a..b8ed7d0 100644
--- a/ambari-server/src/test/python/stacks/2.2/configs/journalnode-upgrade.json
+++ b/ambari-server/src/test/python/stacks/2.2/configs/journalnode-upgrade.json
@@ -316,7 +316,7 @@
             "timeline.metrics.cluster.aggregator.hourly.interval": "3600", 
             "timeline.metrics.host.aggregator.ttl": "86400", 
             "timeline.metrics.cluster.aggregator.hourly.checkpointCutOffMultiplier": "2", 
-            "timeline.metrics.service.webapp.address": "localhost:6188",
+            "timeline.metrics.service.webapp.address": "0.0.0.0:6188",
             "timeline.metrics.aggregator.checkpoint.dir": "/var/lib/ambari-metrics-collector/checkpoint", 
             "timeline.metrics.host.aggregator.minute.disabled": "false", 
             "timeline.metrics.cluster.aggregator.minute.ttl": "2592000", 
@@ -1266,4 +1266,4 @@
             "c6406.ambari.apache.org"
         ]
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/test/python/stacks/2.2/configs/ranger-admin-upgrade.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/configs/ranger-admin-upgrade.json b/ambari-server/src/test/python/stacks/2.2/configs/ranger-admin-upgrade.json
index 42c7403..7ad76de 100644
--- a/ambari-server/src/test/python/stacks/2.2/configs/ranger-admin-upgrade.json
+++ b/ambari-server/src/test/python/stacks/2.2/configs/ranger-admin-upgrade.json
@@ -396,7 +396,7 @@
             "timeline.metrics.cluster.aggregator.hourly.interval": "3600", 
             "timeline.metrics.host.aggregator.ttl": "86400", 
             "timeline.metrics.cluster.aggregator.hourly.checkpointCutOffMultiplier": "2", 
-            "timeline.metrics.service.webapp.address": "localhost:6188",
+            "timeline.metrics.service.webapp.address": "0.0.0.0:6188",
             "timeline.metrics.aggregator.checkpoint.dir": "/var/lib/ambari-metrics-collector/checkpoint", 
             "timeline.metrics.host.aggregator.minute.disabled": "false", 
             "timeline.metrics.cluster.aggregator.minute.ttl": "2592000", 
@@ -1016,4 +1016,4 @@
             "c6409.ambari.apache.org"
         ]
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/test/python/stacks/2.2/configs/ranger-usersync-upgrade.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/configs/ranger-usersync-upgrade.json b/ambari-server/src/test/python/stacks/2.2/configs/ranger-usersync-upgrade.json
index cffec7e..7b770a7 100644
--- a/ambari-server/src/test/python/stacks/2.2/configs/ranger-usersync-upgrade.json
+++ b/ambari-server/src/test/python/stacks/2.2/configs/ranger-usersync-upgrade.json
@@ -391,7 +391,7 @@
             "timeline.metrics.cluster.aggregator.hourly.interval": "3600", 
             "timeline.metrics.host.aggregator.ttl": "86400", 
             "timeline.metrics.cluster.aggregator.hourly.checkpointCutOffMultiplier": "2", 
-            "timeline.metrics.service.webapp.address": "localhost:6188",
+            "timeline.metrics.service.webapp.address": "0.0.0.0:6188",
             "timeline.metrics.aggregator.checkpoint.dir": "/var/lib/ambari-metrics-collector/checkpoint", 
             "timeline.metrics.host.aggregator.minute.disabled": "false", 
             "timeline.metrics.cluster.aggregator.minute.ttl": "2592000", 
@@ -1011,4 +1011,4 @@
             "c6409.ambari.apache.org"
         ]
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/test/python/stacks/2.3/configs/ats_1_5.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/configs/ats_1_5.json b/ambari-server/src/test/python/stacks/2.3/configs/ats_1_5.json
index cd251d1..b4342ad 100644
--- a/ambari-server/src/test/python/stacks/2.3/configs/ats_1_5.json
+++ b/ambari-server/src/test/python/stacks/2.3/configs/ats_1_5.json
@@ -833,7 +833,7 @@
             "timeline.metrics.host.aggregator.ttl": "86400",
             "timeline.metrics.cluster.aggregator.hourly.checkpointCutOffMultiplier": "2",
             "timeline.metrics.service.cluster.aggregator.appIds": "datanode,nodemanager,hbase",
-            "timeline.metrics.service.webapp.address": "localhost:6188",
+            "timeline.metrics.service.webapp.address": "0.0.0.0:6188",
             "timeline.metrics.cluster.aggregator.hourly.disabled": "false",
             "timeline.metrics.aggregator.checkpoint.dir": "/var/lib/ambari-metrics-collector/checkpoint",
             "timeline.metrics.hbase.data.block.encoding": "FAST_DIFF",

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/ambari-server/src/test/python/stacks/2.5/configs/hsi_default.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.5/configs/hsi_default.json b/ambari-server/src/test/python/stacks/2.5/configs/hsi_default.json
index 1cbb8ee..ffdd5e9 100644
--- a/ambari-server/src/test/python/stacks/2.5/configs/hsi_default.json
+++ b/ambari-server/src/test/python/stacks/2.5/configs/hsi_default.json
@@ -929,7 +929,7 @@
             "timeline.metrics.host.aggregator.ttl": "86400",
             "timeline.metrics.cluster.aggregator.hourly.checkpointCutOffMultiplier": "2",
             "timeline.metrics.service.cluster.aggregator.appIds": "datanode,nodemanager,hbase",
-            "timeline.metrics.service.webapp.address": "localhost:6188",
+            "timeline.metrics.service.webapp.address": "0.0.0.0:6188",
             "timeline.metrics.cluster.aggregator.hourly.disabled": "false",
             "timeline.metrics.aggregator.checkpoint.dir": "/var/lib/ambari-metrics-collector/checkpoint",
             "timeline.metrics.hbase.data.block.encoding": "FAST_DIFF",

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1bfc6dd/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
index 42bd3ba..30bc2b0 100644
--- a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
+++ b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
@@ -266,6 +266,7 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
             if (cluster.getDesiredConfigs().containsKey("ams-site")) {
               Map<String, String> amsConfigs = ambariClient.getConfiguration(cluster, "ams-site", cluster.getDesiredConfigs().get("ams-site"));
               AmbariService amsService = ambariClient.getService(cluster, "AMBARI_METRICS");
+              // TODO add metrics collector HA support
               List<AmbariHostComponent> hostsList = amsService.getComponentsToHostComponentsMap().get("METRICS_COLLECTOR");
               if (hostsList != null && hostsList.size() > 0) {
                 String collectorHostName = hostsList.get(0).getHostName();