You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2015/04/29 20:35:48 UTC

hbase git commit: HBASE-13564 Master MBeans are not published (Ashish Singhi) + Addendum

Repository: hbase
Updated Branches:
  refs/heads/master 2e6cd5a47 -> 4120f657b


HBASE-13564 Master MBeans are not published (Ashish Singhi) + Addendum


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

Branch: refs/heads/master
Commit: 4120f657b90906f4c68f8446ddfd8758b2f39453
Parents: 2e6cd5a
Author: stack <st...@apache.org>
Authored: Wed Apr 29 11:35:31 2015 -0700
Committer: stack <st...@apache.org>
Committed: Wed Apr 29 11:35:31 2015 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/JMXListener.java   | 16 ++++++++++++----
 src/main/asciidoc/_chapters/configuration.adoc      |  5 ++---
 2 files changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/4120f657/hbase-server/src/main/java/org/apache/hadoop/hbase/JMXListener.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/JMXListener.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/JMXListener.java
index d1a30e8..0d1c7c4 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/JMXListener.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/JMXListener.java
@@ -51,7 +51,8 @@ public class JMXListener implements Coprocessor {
   private static final Log LOG = LogFactory.getLog(JMXListener.class);
   public static final String RMI_REGISTRY_PORT_CONF_KEY = ".rmi.registry.port";
   public static final String RMI_CONNECTOR_PORT_CONF_KEY = ".rmi.connector.port";
-  public static final int defRMIRegistryPort = 10102;
+  public static final int defMasterRMIRegistryPort = 10101;
+  public static final int defRegionserverRMIRegistryPort = 10102;
 
   /**
    * workaround for HBASE-11146
@@ -163,11 +164,17 @@ public class JMXListener implements Coprocessor {
     Configuration conf = env.getConfiguration();
 
     if (env instanceof MasterCoprocessorEnvironment) {
-      LOG.error("JMXListener should not be loaded in Master Environment!");
+      // running on Master
+      rmiRegistryPort =
+          conf.getInt("master" + RMI_REGISTRY_PORT_CONF_KEY, defMasterRMIRegistryPort);
+      rmiConnectorPort = conf.getInt("master" + RMI_CONNECTOR_PORT_CONF_KEY, rmiRegistryPort);
+      LOG.info("Master rmiRegistryPort:" + rmiRegistryPort + ",Master rmiConnectorPort:"
+          + rmiConnectorPort);
     } else if (env instanceof RegionServerCoprocessorEnvironment) {
-      // running on RegionServer --since 0.99 HMaster is also a HRegionServer
+      // running on RegionServer
       rmiRegistryPort =
-        conf.getInt("regionserver" + RMI_REGISTRY_PORT_CONF_KEY, defRMIRegistryPort);
+        conf.getInt("regionserver" + RMI_REGISTRY_PORT_CONF_KEY,
+        defRegionserverRMIRegistryPort);
       rmiConnectorPort =
         conf.getInt("regionserver" + RMI_CONNECTOR_PORT_CONF_KEY, rmiRegistryPort);
       LOG.info("RegionServer rmiRegistryPort:" + rmiRegistryPort
@@ -175,6 +182,7 @@ public class JMXListener implements Coprocessor {
 
     } else if (env instanceof RegionCoprocessorEnvironment) {
       LOG.error("JMXListener should not be loaded in Region Environment!");
+      return;
     }
 
     synchronized(JMXListener.class) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/4120f657/src/main/asciidoc/_chapters/configuration.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/_chapters/configuration.adoc b/src/main/asciidoc/_chapters/configuration.adoc
index ed00a49..2b09664 100644
--- a/src/main/asciidoc/_chapters/configuration.adoc
+++ b/src/main/asciidoc/_chapters/configuration.adoc
@@ -994,8 +994,7 @@ To enable it in 0.99 or above, add below property in _hbase-site.xml_:
 NOTE: DO NOT set `com.sun.management.jmxremote.port` for Java VM at the same time.
 
 Currently it supports Master and RegionServer Java VM.
-The reason why you only configure coprocessor for 'regionserver' is that, starting from HBase 0.99, a Master IS also a RegionServer.
-(See link:https://issues.apache.org/jira/browse/HBASE-10569[HBASE-10569] for more information.) By default, the JMX listens on TCP port 10102, you can further configure the port using below properties:
+By default, the JMX listens on TCP port 10102, you can further configure the port using below properties:
 
 [source,xml]
 ----
@@ -1062,7 +1061,7 @@ Finally start `jconsole` on the client using the key store:
 jconsole -J-Djavax.net.ssl.trustStore=/home/tianq/jconsoleKeyStore
 ----
 
-NOTE: for HBase 0.98, To enable the HBase JMX implementation on Master, you also need to add below property in _hbase-site.xml_: 
+NOTE: To enable the HBase JMX implementation on Master, you also need to add below property in _hbase-site.xml_: 
 
 [source,xml]
 ----