Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 8e69f3f86 -> 3cba73acf
  refs/heads/trunk ea08b971c -> 2289c7661


AMBARI-16700. All HBase-HA deployment fail with 'Caught exception getting JMX 
metrics' in ambari server log (aonishuk)


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

Branch: refs/heads/trunk
Commit: 2289c766126482e0f7eff7ad31f90db6b942d8ce
Parents: ea08b97
Author: Andrew Onishuk <aonis...@hortonworks.com>
Authored: Tue May 17 16:55:06 2016 +0300
Committer: Andrew Onishuk <aonis...@hortonworks.com>
Committed: Tue May 17 16:55:06 2016 +0300

----------------------------------------------------------------------
 .../controller/internal/AbstractProviderModule.java      |  2 ++
 .../server/controller/jmx/JMXPropertyProvider.java       | 11 ++++++++---
 .../controller/metrics/RestMetricsPropertyProvider.java  |  8 ++++++--
 3 files changed, 16 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2289c766/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 55e49d9..d30b9d2 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
@@ -122,6 +122,7 @@ public abstract class AbstractProviderModule implements 
ProviderModule,
     componentServiceMap.put("DATANODE", Service.Type.HDFS);
     componentServiceMap.put("JOURNALNODE", Service.Type.HDFS);
     componentServiceMap.put("HBASE_MASTER", Service.Type.HBASE);
+    componentServiceMap.put("HBASE_REGIONSERVER", Service.Type.HBASE);
     componentServiceMap.put("RESOURCEMANAGER", Service.Type.YARN);
     componentServiceMap.put("NODEMANAGER", Service.Type.YARN);
     componentServiceMap.put("HISTORYSERVER", Service.Type.MAPREDUCE2);
@@ -139,6 +140,7 @@ public abstract class AbstractProviderModule implements 
ProviderModule,
 
     initPropMap = new HashMap<String, String[]>();
     initPropMap.put("HBASE_MASTER", new String[]{"hbase.master.info.port"});
+    initPropMap.put("HBASE_REGIONSERVER", new 
String[]{"hbase.regionserver.info.port"});
     serviceDesiredProperties.put(Service.Type.HBASE, initPropMap);
 
     initPropMap = new HashMap<String, String[]>();

http://git-wip-us.apache.org/repos/asf/ambari/blob/2289c766/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java
index 0aa0a1e..1ccc5df 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXPropertyProvider.java
@@ -18,6 +18,7 @@
 
 package org.apache.ambari.server.controller.jmx;
 
+import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.controller.internal.PropertyInfo;
 import org.apache.ambari.server.controller.metrics.MetricHostProvider;
 import 
org.apache.ambari.server.controller.metrics.ThreadPoolEnabledPropertyProvider;
@@ -206,6 +207,7 @@ public class JMXPropertyProvider extends 
ThreadPoolEnabledPropertyProvider {
 
     InputStream in = null;
 
+    String spec = null;
     try {
       try {
         for (String hostName : hostNames) {
@@ -215,10 +217,11 @@ public class JMXPropertyProvider extends 
ThreadPoolEnabledPropertyProvider {
               LOG.warn("Unable to get JMX metrics.  No port value for " + 
componentName);
               return resource;
             }
+            spec = getSpec(protocol, hostName, port, "/jmx");
             if (LOG.isDebugEnabled()) {
-              LOG.debug("Spec: " + getSpec(protocol, hostName, port, "/jmx"));
+              LOG.debug("Spec: " + spec);
             }
-            in = streamProvider.readFrom(getSpec(protocol, hostName, port, 
"/jmx"));
+            in = streamProvider.readFrom(spec);
             // if the ticket becomes invalid (timeout) then bail out
             if (!ticket.isValid()) {
               return resource;
@@ -227,7 +230,9 @@ public class JMXPropertyProvider extends 
ThreadPoolEnabledPropertyProvider {
             getHadoopMetricValue(in, ids, resource, request, ticket);
 
           } catch (IOException e) {
-            logException(e);
+            AmbariException detailedException = new AmbariException(
+                String.format("Unable to get JMX metrics from the host %s for 
the component %s. Spec: %s", hostName, componentName, spec), e);
+            logException(detailedException);
           }
         }
       } finally {

http://git-wip-us.apache.org/repos/asf/ambari/blob/2289c766/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
index fc76b1e..c579705 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
@@ -222,8 +222,10 @@ public class RestMetricsPropertyProvider extends 
ThreadPoolEnabledPropertyProvid
     HashMap<String, Set<String>> urls = extractPropertyURLs(resultIds, 
propertyInfos);
 
     for (String url : urls.keySet()) {
+      String spec = null;
       try {
-        InputStream in = streamProvider.readFrom(getSpec(protocol, hostname, 
port, url));
+        spec = getSpec(protocol, hostname, port, url);
+        InputStream in = streamProvider.readFrom(spec);
         if (!ticket.isValid()) {
           if (in != null) {
             in.close();
@@ -236,7 +238,9 @@ public class RestMetricsPropertyProvider extends 
ThreadPoolEnabledPropertyProvid
             in.close();
           }
       } catch (IOException e) {
-        logException(e);
+        AmbariException detailedException = new AmbariException(
+            String.format("Unable to get REST metrics from the host %s for the 
component %s. Spec: %s", hostname, resourceComponentName, spec), e);
+        logException(detailedException);
       }
     }
     return resource;

Reply via email to