hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject hbase git commit: HBASE-13453. Master should not bind to region server ports (Srikanth Srungarapu)
Date Wed, 15 Apr 2015 18:06:56 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 c2eeddfb2 -> 65bf10a47


HBASE-13453. Master should not bind to region server ports (Srikanth Srungarapu)


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

Branch: refs/heads/branch-1
Commit: 65bf10a47fccdfabf957f3fb1c0072a257da7780
Parents: c2eeddf
Author: Devaraj Das <ddas@apache.org>
Authored: Wed Apr 15 11:02:08 2015 -0700
Committer: Devaraj Das <ddas@apache.org>
Committed: Wed Apr 15 11:06:43 2015 -0700

----------------------------------------------------------------------
 hbase-common/src/main/resources/hbase-default.xml               | 5 +++++
 .../src/main/java/org/apache/hadoop/hbase/master/HMaster.java   | 3 +++
 .../org/apache/hadoop/hbase/regionserver/HRegionServer.java     | 4 ++++
 .../org/apache/hadoop/hbase/regionserver/RSRpcServices.java     | 5 +++++
 4 files changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/65bf10a4/hbase-common/src/main/resources/hbase-default.xml
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/resources/hbase-default.xml b/hbase-common/src/main/resources/hbase-default.xml
index 2b4ca33..2a98d7d 100644
--- a/hbase-common/src/main/resources/hbase-default.xml
+++ b/hbase-common/src/main/resources/hbase-default.xml
@@ -96,6 +96,11 @@ possible configurations would overwhelm and obscure the important.
   </property>
 
   <!--Master configurations-->
+  <property >
+    <name>hbase.master.port</name>
+    <value>16000</value>
+    <description>The port the HBase Master should bind to.</description>
+  </property>
   <property>
     <name>hbase.master.info.port</name>
     <value>16010</value>

http://git-wip-us.apache.org/repos/asf/hbase/blob/65bf10a4/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
index 2d05c96..71ccf31 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
@@ -419,6 +419,9 @@ public class HMaster extends HRegionServer implements MasterServices,
Server {
     }
 
     RedirectServlet.regionServerInfoPort = infoServer.getPort();
+    if(RedirectServlet.regionServerInfoPort == infoPort) {
+      return infoPort;
+    }
     masterJettyServer = new org.mortbay.jetty.Server();
     Connector connector = new SelectChannelConnector();
     connector.setHost(addr);

http://git-wip-us.apache.org/repos/asf/hbase/blob/65bf10a4/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
index 83f37d9..27b6e8d 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
@@ -1730,6 +1730,10 @@ public class HRegionServer extends HasThread implements
   private int putUpWebUI() throws IOException {
     int port = this.conf.getInt(HConstants.REGIONSERVER_INFO_PORT,
       HConstants.DEFAULT_REGIONSERVER_INFOPORT);
+    if(this instanceof HMaster) {
+      port = conf.getInt(HConstants.MASTER_INFO_PORT,
+          HConstants.DEFAULT_MASTER_INFOPORT);
+    }
     // -1 is for disabling info server
     if (port < 0) return port;
     String addr = this.conf.get("hbase.regionserver.info.bindAddress", "0.0.0.0");

http://git-wip-us.apache.org/repos/asf/hbase/blob/65bf10a4/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
index adbe6dd..1c9a22a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
@@ -84,6 +84,7 @@ import org.apache.hadoop.hbase.ipc.RpcServer.BlockingServiceAndInterface;
 import org.apache.hadoop.hbase.ipc.RpcServerInterface;
 import org.apache.hadoop.hbase.ipc.ServerNotRunningYetException;
 import org.apache.hadoop.hbase.ipc.ServerRpcController;
+import org.apache.hadoop.hbase.master.MasterRpcServices;
 import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.protobuf.RequestConverter;
 import org.apache.hadoop.hbase.protobuf.ResponseConverter;
@@ -802,6 +803,10 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
     String hostname = getHostname(rs.conf);
     int port = rs.conf.getInt(HConstants.REGIONSERVER_PORT,
       HConstants.DEFAULT_REGIONSERVER_PORT);
+    if(this instanceof MasterRpcServices) {
+      port = rs.conf.getInt(HConstants.MASTER_PORT,
+          HConstants.DEFAULT_MASTER_PORT);
+    }
     // Creation of a HSA will force a resolve.
     InetSocketAddress initialIsa = new InetSocketAddress(hostname, port);
     InetSocketAddress bindAddress = new InetSocketAddress(


Mime
View raw message