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 (Shaohui)
Date Fri, 17 Oct 2014 20:53:01 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 728fc543e -> 349a56ae2


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


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

Branch: refs/heads/master
Commit: 349a56ae2c88e62917ba8923283ad4ca0c83841c
Parents: 728fc54
Author: Ted Yu <tedyu@apache.org>
Authored: Fri Oct 17 20:52:55 2014 +0000
Committer: Ted Yu <tedyu@apache.org>
Committed: Fri Oct 17 20:52:55 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/349a56ae/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 831c4da..507d31d 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
@@ -275,7 +275,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/349a56ae/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 dc4bf7b..bf94cdb 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
@@ -767,6 +767,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