You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by av...@apache.org on 2016/02/18 23:23:20 UTC
ambari git commit: AMBARI-15099 : Ambari missing metrics in UI with
Vip settings enabled (avijayan)
Repository: ambari
Updated Branches:
refs/heads/branch-2.2 d12e14c90 -> 1210d0bd5
AMBARI-15099 : Ambari missing metrics in UI with Vip settings enabled (avijayan)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1210d0bd
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1210d0bd
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1210d0bd
Branch: refs/heads/branch-2.2
Commit: 1210d0bd5077fa8358cd9af6107df30f2c074aae
Parents: d12e14c
Author: Aravindan Vijayan <av...@hortonworks.com>
Authored: Thu Feb 18 14:23:00 2016 -0800
Committer: Aravindan Vijayan <av...@hortonworks.com>
Committed: Thu Feb 18 14:23:09 2016 -0800
----------------------------------------------------------------------
.../internal/AbstractProviderModule.java | 31 ++++++++++----------
1 file changed, 16 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/1210d0bd/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
index 52d95e0..ff9b4e4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
@@ -310,7 +310,7 @@ public abstract class AbstractProviderModule implements ProviderModule,
if (!configProperties.isEmpty()) {
clusterMetricserverVipHost = configProperties.get("METRICS_COLLECTOR");
if (clusterMetricserverVipHost != null) {
- clusterMetricCollectorMap.put(clusterName, clusterMetricserverVipHost);
+ LOG.info("Setting Metrics Collector Vip Host : " + clusterMetricserverVipHost);
vipHostConfigPresent = true;
}
}
@@ -340,15 +340,19 @@ public abstract class AbstractProviderModule implements ProviderModule,
if (isHostLive(clusterName, hostname)
&& isHostComponentLive(clusterName, hostname, "AMBARI_METRICS", Role.METRICS_COLLECTOR.name())) {
clusterMetricCollectorMap.put(clusterName, hostname);
- LOG.debug("New Metrics Collector Host : " + hostname);
+ LOG.info("New Metrics Collector Host : " + hostname);
break;
} else {
- LOG.debug("Metrics Collector Host or host component not live : " + hostname);
+ LOG.info("Metrics Collector Host or host component not live : " + hostname);
}
}
}
}
- return clusterMetricCollectorMap.get(clusterName);
+
+ LOG.debug("Cluster Metrics Vip Host : " + clusterMetricserverVipHost);
+ LOG.debug("Cluster Metrics Collector Host : " + clusterMetricCollectorMap.get(clusterName));
+
+ return (clusterMetricserverVipHost != null) ? clusterMetricserverVipHost : clusterMetricCollectorMap.get(clusterName);
}
@Override
@@ -848,19 +852,16 @@ public abstract class AbstractProviderModule implements ProviderModule,
clusterGangliaCollectorMap.put(clusterName, hostName);
}
if (componentName.equals(METRIC_SERVER)) {
- //If vip config not present
// If current collector host is null or if the host or the host component not live
// Update clusterMetricCollectorMap.
- if (!vipHostConfigPresent) {
- String currentCollectorHost = clusterMetricCollectorMap.get(clusterName);
- LOG.debug("Current Metrics collector Host : " + currentCollectorHost);
- if ((currentCollectorHost == null) ||
- !(isHostLive(clusterName, currentCollectorHost) &&
- isHostComponentLive(clusterName, currentCollectorHost, "AMBARI_METRICS", Role.METRICS_COLLECTOR.name()))
- ) {
- LOG.debug("New Metrics collector Host : " + hostName);
- clusterMetricCollectorMap.put(clusterName, hostName);
- }
+ String currentCollectorHost = clusterMetricCollectorMap.get(clusterName);
+ LOG.info("Current Metrics collector Host : " + currentCollectorHost);
+ if ((currentCollectorHost == null) ||
+ !(isHostLive(clusterName, currentCollectorHost) &&
+ isHostComponentLive(clusterName, currentCollectorHost, "AMBARI_METRICS", Role.METRICS_COLLECTOR.name()))
+ ) {
+ LOG.info("New Metrics collector Host : " + hostName);
+ clusterMetricCollectorMap.put(clusterName, hostName);
}
metricServerHosts.add(hostName);
}