hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jxi...@apache.org
Subject svn commit: r1582140 - in /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase: master/HMaster.java regionserver/HRegionServer.java regionserver/RSRpcServices.java
Date Thu, 27 Mar 2014 00:34:44 GMT
Author: jxiang
Date: Thu Mar 27 00:34:43 2014
New Revision: 1582140

URL: http://svn.apache.org/r1582140
Log:
HBASE-10839 NullPointerException in construction of RegionServer in Security Cluster

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java?rev=1582140&r1=1582139&r2=1582140&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java (original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java Thu
Mar 27 00:34:43 2014
@@ -97,6 +97,7 @@ import org.apache.hadoop.hbase.regionser
 import org.apache.hadoop.hbase.regionserver.RSRpcServices;
 import org.apache.hadoop.hbase.regionserver.RegionSplitPolicy;
 import org.apache.hadoop.hbase.replication.regionserver.Replication;
+import org.apache.hadoop.hbase.security.UserProvider;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.CompressionTest;
 import org.apache.hadoop.hbase.util.FSUtils;
@@ -272,6 +273,18 @@ public class HMaster extends HRegionServ
     startActiveMasterManager();
   }
 
+  /**
+   * For compatibility, if failed with regionserver credentials, try the master one
+   */
+  protected void login(UserProvider user, String host) throws IOException {
+    try {
+      super.login(user, host);
+    } catch (IOException ie) {
+      user.login("hbase.master.keytab.file",
+        "hbase.master.kerberos.principal", host);
+    }
+  }
+
   @VisibleForTesting
   public MasterRpcServices getMasterRpcServices() {
     return (MasterRpcServices)rpcServices;

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=1582140&r1=1582139&r2=1582140&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Thu Mar 27 00:34:43 2014
@@ -437,10 +437,9 @@ public class HRegionServer extends HasTh
     // login the zookeeper client principal (if using security)
     ZKUtil.loginClient(this.conf, "hbase.zookeeper.client.keytab.file",
       "hbase.zookeeper.client.kerberos.principal", hostName);
-
     // login the server principal (if using secure Hadoop)
-    userProvider.login("hbase.regionserver.keytab.file",
-      "hbase.regionserver.kerberos.principal", hostName);
+    login(userProvider, hostName);
+
     regionServerAccounting = new RegionServerAccounting();
     cacheConfig = new CacheConfig(conf);
     uncaughtExceptionHandler = new UncaughtExceptionHandler() {
@@ -484,9 +483,15 @@ public class HRegionServer extends HasTh
       catalogTracker.start();
     }
 
+    rpcServices.start();
     putUpWebUI();
   }
 
+  protected void login(UserProvider user, String host) throws IOException {
+    user.login("hbase.regionserver.keytab.file",
+      "hbase.regionserver.kerberos.principal", host);
+  }
+
   protected String getProcessName() {
     return REGIONSERVER;
   }

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java?rev=1582140&r1=1582139&r2=1582140&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
Thu Mar 27 00:34:43 2014
@@ -703,7 +703,6 @@ public class RSRpcServices implements HB
       initialIsa, // BindAddress is IP we got for this server.
       rs.conf,
       rpcSchedulerFactory.create(rs.conf, this));
-    rpcServer.start();
 
     scannerLeaseTimeoutPeriod = rs.conf.getInt(
       HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD,
@@ -759,6 +758,10 @@ public class RSRpcServices implements HB
     return priority;
   }
 
+  void start() {
+    rpcServer.start();
+  }
+
   void stop() {
     closeAllScanners();
     rpcServer.stop();



Mime
View raw message