HBASE-13453. Master should not bind to region server ports (Srikanth Srungarapu)
This commit is contained in:
parent
c2eeddfb27
commit
65bf10a47f
|
@ -96,6 +96,11 @@ possible configurations would overwhelm and obscure the important.
|
||||||
</property>
|
</property>
|
||||||
|
|
||||||
<!--Master configurations-->
|
<!--Master configurations-->
|
||||||
|
<property >
|
||||||
|
<name>hbase.master.port</name>
|
||||||
|
<value>16000</value>
|
||||||
|
<description>The port the HBase Master should bind to.</description>
|
||||||
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>hbase.master.info.port</name>
|
<name>hbase.master.info.port</name>
|
||||||
<value>16010</value>
|
<value>16010</value>
|
||||||
|
|
|
@ -419,6 +419,9 @@ public class HMaster extends HRegionServer implements MasterServices, Server {
|
||||||
}
|
}
|
||||||
|
|
||||||
RedirectServlet.regionServerInfoPort = infoServer.getPort();
|
RedirectServlet.regionServerInfoPort = infoServer.getPort();
|
||||||
|
if(RedirectServlet.regionServerInfoPort == infoPort) {
|
||||||
|
return infoPort;
|
||||||
|
}
|
||||||
masterJettyServer = new org.mortbay.jetty.Server();
|
masterJettyServer = new org.mortbay.jetty.Server();
|
||||||
Connector connector = new SelectChannelConnector();
|
Connector connector = new SelectChannelConnector();
|
||||||
connector.setHost(addr);
|
connector.setHost(addr);
|
||||||
|
|
|
@ -1730,6 +1730,10 @@ public class HRegionServer extends HasThread implements
|
||||||
private int putUpWebUI() throws IOException {
|
private int putUpWebUI() throws IOException {
|
||||||
int port = this.conf.getInt(HConstants.REGIONSERVER_INFO_PORT,
|
int port = this.conf.getInt(HConstants.REGIONSERVER_INFO_PORT,
|
||||||
HConstants.DEFAULT_REGIONSERVER_INFOPORT);
|
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
|
// -1 is for disabling info server
|
||||||
if (port < 0) return port;
|
if (port < 0) return port;
|
||||||
String addr = this.conf.get("hbase.regionserver.info.bindAddress", "0.0.0.0");
|
String addr = this.conf.get("hbase.regionserver.info.bindAddress", "0.0.0.0");
|
||||||
|
|
|
@ -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.RpcServerInterface;
|
||||||
import org.apache.hadoop.hbase.ipc.ServerNotRunningYetException;
|
import org.apache.hadoop.hbase.ipc.ServerNotRunningYetException;
|
||||||
import org.apache.hadoop.hbase.ipc.ServerRpcController;
|
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.ProtobufUtil;
|
||||||
import org.apache.hadoop.hbase.protobuf.RequestConverter;
|
import org.apache.hadoop.hbase.protobuf.RequestConverter;
|
||||||
import org.apache.hadoop.hbase.protobuf.ResponseConverter;
|
import org.apache.hadoop.hbase.protobuf.ResponseConverter;
|
||||||
|
@ -802,6 +803,10 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
|
||||||
String hostname = getHostname(rs.conf);
|
String hostname = getHostname(rs.conf);
|
||||||
int port = rs.conf.getInt(HConstants.REGIONSERVER_PORT,
|
int port = rs.conf.getInt(HConstants.REGIONSERVER_PORT,
|
||||||
HConstants.DEFAULT_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.
|
// Creation of a HSA will force a resolve.
|
||||||
InetSocketAddress initialIsa = new InetSocketAddress(hostname, port);
|
InetSocketAddress initialIsa = new InetSocketAddress(hostname, port);
|
||||||
InetSocketAddress bindAddress = new InetSocketAddress(
|
InetSocketAddress bindAddress = new InetSocketAddress(
|
||||||
|
|
Loading…
Reference in New Issue