hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmhs...@apache.org
Subject [41/50] [abbrv] hbase git commit: HBASE-13453. Master should not bind to region server ports (Srikanth Srungarapu)
Date Fri, 01 May 2015 15:28:27 GMT
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/14261bc9
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/14261bc9
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/14261bc9

Branch: refs/heads/hbase-11339
Commit: 14261bc9e515bbaf2fa40f5779cb83a3372f0e57
Parents: 2da1bf1
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:02:08 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/14261bc9/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 ff4136b..bf14a53 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/14261bc9/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 45bcdcb..bcc43f4 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
@@ -417,6 +417,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/14261bc9/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 f15eb1b..0cc1e51 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
@@ -1734,6 +1734,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/14261bc9/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 f9b8d61..15bf2cb 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
@@ -81,6 +81,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;
@@ -800,6 +801,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