hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject git commit: HBASE-12263 RegionServer listens on localhost in distributed cluster when DNS is unavailable
Date Fri, 17 Oct 2014 20:52:23 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 3feec7742 -> cad86cca0


HBASE-12263 RegionServer listens on localhost in distributed cluster when DNS is unavailable


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

Branch: refs/heads/branch-1
Commit: cad86cca00b781344137710d8d8b1eecb5f6348e
Parents: 3feec77
Author: Ted Yu <tedyu@apache.org>
Authored: Fri Oct 17 20:52:15 2014 +0000
Committer: Ted Yu <tedyu@apache.org>
Committed: Fri Oct 17 20:52:15 2014 +0000

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/master/HMaster.java     |  2 +-
 .../apache/hadoop/hbase/regionserver/RSRpcServices.java  | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/cad86cca/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 41a748f..cfd5f4c 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
@@ -270,7 +270,7 @@ public class HMaster extends HRegionServer implements MasterServices,
Server {
       conf.getLong("hbase.master.buffer.for.rs.fatals", 1*1024*1024));
 
     LOG.info("hbase.rootdir=" + FSUtils.getRootDir(this.conf) +
-        ", hbase.cluster.distributed=" + this.conf.getBoolean("hbase.cluster.distributed",
false));
+        ", hbase.cluster.distributed=" + this.conf.getBoolean(HConstants.CLUSTER_DISTRIBUTED,
false));
 
     Replication.decorateMasterConfiguration(this.conf);
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/cad86cca/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 ad75542..2000717 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
@@ -761,6 +761,17 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
       Strings.domainNamePointerToHostName(DNS.getDefaultHost(
         rs.conf.get("hbase.regionserver.dns.interface", "default"),
         rs.conf.get("hbase.regionserver.dns.nameserver", "default"))));
+
+    boolean mode =
+        rs.conf.getBoolean(HConstants.CLUSTER_DISTRIBUTED, HConstants.DEFAULT_CLUSTER_DISTRIBUTED);
+    if (mode == HConstants.CLUSTER_IS_DISTRIBUTED && hostname.equals(HConstants.LOCALHOST))
{
+      String msg =
+          "The hostname of regionserver cannot be set to localhost "
+              + "in a fully-distributed setup because it won't be reachable. "
+              + "See \"Getting Started\" for more information.";
+      LOG.fatal(msg);
+      throw new IOException(msg);
+    }
     int port = rs.conf.getInt(HConstants.REGIONSERVER_PORT,
       HConstants.DEFAULT_REGIONSERVER_PORT);
     // Creation of a HSA will force a resolve.


Mime
View raw message