You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by pl...@apache.org on 2017/12/25 02:25:51 UTC
directory-kerby git commit: Update the support of HBase.
Repository: directory-kerby
Updated Branches:
refs/heads/has-project 779def892 -> 510eebfb6
Update the support of HBase.
Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/510eebfb
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/510eebfb
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/510eebfb
Branch: refs/heads/has-project
Commit: 510eebfb6875c90c3794e8a6cabab7e31a17216e
Parents: 779def8
Author: plusplusjiajia <ji...@intel.com>
Authored: Mon Dec 25 10:22:15 2017 +0800
Committer: plusplusjiajia <ji...@intel.com>
Committed: Mon Dec 25 10:22:15 2017 +0800
----------------------------------------------------------------------
has/supports/hbase/README.md | 4 +-
.../hbase/hbase-1.1.10-hadoop-2.5.1.patch | 136 -------------------
has/supports/hbase/hbase-hadoop-2.5.1.patch | 136 +++++++++++++++++++
3 files changed, 139 insertions(+), 137 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/510eebfb/has/supports/hbase/README.md
----------------------------------------------------------------------
diff --git a/has/supports/hbase/README.md b/has/supports/hbase/README.md
index d55a35c..451ade5 100644
--- a/has/supports/hbase/README.md
+++ b/has/supports/hbase/README.md
@@ -1,9 +1,11 @@
Enable HBase
===============
+The Hadoop version in HBase should be checked, from 1.0.0 to 1.3.1 the dependency of hadoop version is 2.5.1.
+
## 1. Apply the patch to hadoop-2.5.1 source code
```
-git apply hbase-1.1.10-hadoop-2.5.1.patch
+git apply hbase-hadoop-2.5.1.patch
```
## 2. Build
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/510eebfb/has/supports/hbase/hbase-1.1.10-hadoop-2.5.1.patch
----------------------------------------------------------------------
diff --git a/has/supports/hbase/hbase-1.1.10-hadoop-2.5.1.patch b/has/supports/hbase/hbase-1.1.10-hadoop-2.5.1.patch
deleted file mode 100644
index f00cec5..0000000
--- a/has/supports/hbase/hbase-1.1.10-hadoop-2.5.1.patch
+++ /dev/null
@@ -1,136 +0,0 @@
-diff --git a/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/KerberosUtil.java b/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/KerberosUtil.java
-index ca0fce2..b43476d 100644
---- a/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/KerberosUtil.java
-+++ b/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/KerberosUtil.java
-@@ -44,7 +44,8 @@
- public static String getKrb5LoginModuleName() {
- return System.getProperty("java.vendor").contains("IBM")
- ? "com.ibm.security.auth.module.Krb5LoginModule"
-- : "com.sun.security.auth.module.Krb5LoginModule";
-+// : "com.sun.security.auth.module.Krb5LoginModule";
-+ :"org.apache.kerby.has.client.HasLoginModule";
- }
-
- public static Oid getOidInstance(String oidName)
-diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java
-index 4f117fd..7a8fc43 100644
---- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java
-+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java
-@@ -88,8 +88,10 @@
- private static final float TICKET_RENEW_WINDOW = 0.80f;
- static final String HADOOP_USER_NAME = "HADOOP_USER_NAME";
- static final String HADOOP_PROXY_USER = "HADOOP_PROXY_USER";
--
-- /**
-+ public static final String HADOOP_SECURITY_AUTHENTICATION_USE_HAS
-+ = "hadoop.security.authentication.use.has";
-+
-+ /**
- * UgiMetrics maintains UGI activity statistics
- * and publishes them through the metrics interfaces.
- */
-@@ -434,6 +436,8 @@ public String toString() {
- "hadoop-user-kerberos";
- private static final String KEYTAB_KERBEROS_CONFIG_NAME =
- "hadoop-keytab-kerberos";
-+ private static final String HAS_KERBEROS_CONFIG_NAME =
-+ "hadoop-has-kerberos";
-
- private static final Map<String, String> BASIC_JAAS_OPTIONS =
- new HashMap<String,String>();
-@@ -490,6 +494,29 @@ public String toString() {
- KEYTAB_KERBEROS_OPTIONS.put("refreshKrb5Config", "true");
- KEYTAB_KERBEROS_OPTIONS.putAll(BASIC_JAAS_OPTIONS);
- }
-+
-+ private static final Map<String, String> HAS_KERBEROS_OPTIONS =
-+ new HashMap<String, String>();
-+
-+ static {
-+ if (IBM_JAVA) {
-+ HAS_KERBEROS_OPTIONS.put("useDefaultCcache", "true");
-+ } else {
-+ HAS_KERBEROS_OPTIONS.put("doNotPrompt", "true");
-+ HAS_KERBEROS_OPTIONS.put("useTgtTicket", "true");
-+ HAS_KERBEROS_OPTIONS.put("hadoopSecurityHas", conf.get("hadoop.security.has"));
-+ }
-+ HAS_KERBEROS_OPTIONS.putAll(BASIC_JAAS_OPTIONS);
-+ }
-+
-+ private static final AppConfigurationEntry HAS_KERBEROS_LOGIN =
-+ new AppConfigurationEntry(KerberosUtil.getKrb5LoginModuleName(),
-+ LoginModuleControlFlag.OPTIONAL,
-+ HAS_KERBEROS_OPTIONS);
-+ private static final AppConfigurationEntry[] HAS_KERBEROS_CONF =
-+ new AppConfigurationEntry[]{OS_SPECIFIC_LOGIN, HAS_KERBEROS_LOGIN,
-+ HADOOP_LOGIN};
-+
- private static final AppConfigurationEntry KEYTAB_KERBEROS_LOGIN =
- new AppConfigurationEntry(KerberosUtil.getKrb5LoginModuleName(),
- LoginModuleControlFlag.REQUIRED,
-@@ -520,11 +547,45 @@ public String toString() {
- }
- KEYTAB_KERBEROS_OPTIONS.put("principal", keytabPrincipal);
- return KEYTAB_KERBEROS_CONF;
-+ } else if(HAS_KERBEROS_CONFIG_NAME.equals(appName)) {
-+ return HAS_KERBEROS_CONF;
- }
- return null;
- }
- }
-
-+ /**
-+ * Log a user in from a tgt ticket.
-+ * @throws IOException
-+ */
-+ @InterfaceAudience.Public
-+ @InterfaceStability.Evolving
-+ public synchronized
-+ static void loginUserFromHas() throws IOException {
-+ if (!isSecurityEnabled())
-+ return;
-+
-+ Subject subject = new Subject();
-+ LoginContext login;
-+ long start = 0;
-+ try {
-+ login = newLoginContext(HadoopConfiguration.HAS_KERBEROS_CONFIG_NAME,
-+ subject, new HadoopConfiguration());
-+ start = Time.now();
-+ login.login();
-+ metrics.loginSuccess.add(Time.now() - start);
-+ loginUser = new UserGroupInformation(subject);
-+ loginUser.setLogin(login);
-+ loginUser.setAuthenticationMethod(AuthenticationMethod.KERBEROS);
-+ } catch (LoginException le) {
-+ if (start > 0) {
-+ metrics.loginFailure.add(Time.now() - start);
-+ }
-+ throw new IOException("Login failure for " + le, le);
-+ }
-+ LOG.info("Login successful for user " + loginUser.getUserName());
-+ }
-+
- private static String prependFileAuthority(String keytabPath) {
- return keytabPath.startsWith("file://") ? keytabPath
- : "file://" + keytabPath;
-@@ -751,9 +812,16 @@ static void loginUserFromSubject(Subject subject) throws IOException {
- if (subject == null) {
- subject = new Subject();
- }
-- LoginContext login =
-- newLoginContext(authenticationMethod.getLoginAppName(),
-- subject, new HadoopConfiguration());
-+ LoginContext login = null;
-+ if (authenticationMethod.equals(AuthenticationMethod.KERBEROS)
-+ && conf.getBoolean(HADOOP_SECURITY_AUTHENTICATION_USE_HAS, false)) {
-+ login = newLoginContext(HadoopConfiguration.HAS_KERBEROS_CONFIG_NAME,
-+ subject, new HadoopConfiguration());
-+ } else {
-+ login = newLoginContext(authenticationMethod.getLoginAppName(),
-+ subject, new HadoopConfiguration());
-+ }
-+
- login.login();
- UserGroupInformation realUser = new UserGroupInformation(subject);
- realUser.setLogin(login);
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/510eebfb/has/supports/hbase/hbase-hadoop-2.5.1.patch
----------------------------------------------------------------------
diff --git a/has/supports/hbase/hbase-hadoop-2.5.1.patch b/has/supports/hbase/hbase-hadoop-2.5.1.patch
new file mode 100644
index 0000000..f00cec5
--- /dev/null
+++ b/has/supports/hbase/hbase-hadoop-2.5.1.patch
@@ -0,0 +1,136 @@
+diff --git a/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/KerberosUtil.java b/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/KerberosUtil.java
+index ca0fce2..b43476d 100644
+--- a/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/KerberosUtil.java
++++ b/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/KerberosUtil.java
+@@ -44,7 +44,8 @@
+ public static String getKrb5LoginModuleName() {
+ return System.getProperty("java.vendor").contains("IBM")
+ ? "com.ibm.security.auth.module.Krb5LoginModule"
+- : "com.sun.security.auth.module.Krb5LoginModule";
++// : "com.sun.security.auth.module.Krb5LoginModule";
++ :"org.apache.kerby.has.client.HasLoginModule";
+ }
+
+ public static Oid getOidInstance(String oidName)
+diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java
+index 4f117fd..7a8fc43 100644
+--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java
++++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java
+@@ -88,8 +88,10 @@
+ private static final float TICKET_RENEW_WINDOW = 0.80f;
+ static final String HADOOP_USER_NAME = "HADOOP_USER_NAME";
+ static final String HADOOP_PROXY_USER = "HADOOP_PROXY_USER";
+-
+- /**
++ public static final String HADOOP_SECURITY_AUTHENTICATION_USE_HAS
++ = "hadoop.security.authentication.use.has";
++
++ /**
+ * UgiMetrics maintains UGI activity statistics
+ * and publishes them through the metrics interfaces.
+ */
+@@ -434,6 +436,8 @@ public String toString() {
+ "hadoop-user-kerberos";
+ private static final String KEYTAB_KERBEROS_CONFIG_NAME =
+ "hadoop-keytab-kerberos";
++ private static final String HAS_KERBEROS_CONFIG_NAME =
++ "hadoop-has-kerberos";
+
+ private static final Map<String, String> BASIC_JAAS_OPTIONS =
+ new HashMap<String,String>();
+@@ -490,6 +494,29 @@ public String toString() {
+ KEYTAB_KERBEROS_OPTIONS.put("refreshKrb5Config", "true");
+ KEYTAB_KERBEROS_OPTIONS.putAll(BASIC_JAAS_OPTIONS);
+ }
++
++ private static final Map<String, String> HAS_KERBEROS_OPTIONS =
++ new HashMap<String, String>();
++
++ static {
++ if (IBM_JAVA) {
++ HAS_KERBEROS_OPTIONS.put("useDefaultCcache", "true");
++ } else {
++ HAS_KERBEROS_OPTIONS.put("doNotPrompt", "true");
++ HAS_KERBEROS_OPTIONS.put("useTgtTicket", "true");
++ HAS_KERBEROS_OPTIONS.put("hadoopSecurityHas", conf.get("hadoop.security.has"));
++ }
++ HAS_KERBEROS_OPTIONS.putAll(BASIC_JAAS_OPTIONS);
++ }
++
++ private static final AppConfigurationEntry HAS_KERBEROS_LOGIN =
++ new AppConfigurationEntry(KerberosUtil.getKrb5LoginModuleName(),
++ LoginModuleControlFlag.OPTIONAL,
++ HAS_KERBEROS_OPTIONS);
++ private static final AppConfigurationEntry[] HAS_KERBEROS_CONF =
++ new AppConfigurationEntry[]{OS_SPECIFIC_LOGIN, HAS_KERBEROS_LOGIN,
++ HADOOP_LOGIN};
++
+ private static final AppConfigurationEntry KEYTAB_KERBEROS_LOGIN =
+ new AppConfigurationEntry(KerberosUtil.getKrb5LoginModuleName(),
+ LoginModuleControlFlag.REQUIRED,
+@@ -520,11 +547,45 @@ public String toString() {
+ }
+ KEYTAB_KERBEROS_OPTIONS.put("principal", keytabPrincipal);
+ return KEYTAB_KERBEROS_CONF;
++ } else if(HAS_KERBEROS_CONFIG_NAME.equals(appName)) {
++ return HAS_KERBEROS_CONF;
+ }
+ return null;
+ }
+ }
+
++ /**
++ * Log a user in from a tgt ticket.
++ * @throws IOException
++ */
++ @InterfaceAudience.Public
++ @InterfaceStability.Evolving
++ public synchronized
++ static void loginUserFromHas() throws IOException {
++ if (!isSecurityEnabled())
++ return;
++
++ Subject subject = new Subject();
++ LoginContext login;
++ long start = 0;
++ try {
++ login = newLoginContext(HadoopConfiguration.HAS_KERBEROS_CONFIG_NAME,
++ subject, new HadoopConfiguration());
++ start = Time.now();
++ login.login();
++ metrics.loginSuccess.add(Time.now() - start);
++ loginUser = new UserGroupInformation(subject);
++ loginUser.setLogin(login);
++ loginUser.setAuthenticationMethod(AuthenticationMethod.KERBEROS);
++ } catch (LoginException le) {
++ if (start > 0) {
++ metrics.loginFailure.add(Time.now() - start);
++ }
++ throw new IOException("Login failure for " + le, le);
++ }
++ LOG.info("Login successful for user " + loginUser.getUserName());
++ }
++
+ private static String prependFileAuthority(String keytabPath) {
+ return keytabPath.startsWith("file://") ? keytabPath
+ : "file://" + keytabPath;
+@@ -751,9 +812,16 @@ static void loginUserFromSubject(Subject subject) throws IOException {
+ if (subject == null) {
+ subject = new Subject();
+ }
+- LoginContext login =
+- newLoginContext(authenticationMethod.getLoginAppName(),
+- subject, new HadoopConfiguration());
++ LoginContext login = null;
++ if (authenticationMethod.equals(AuthenticationMethod.KERBEROS)
++ && conf.getBoolean(HADOOP_SECURITY_AUTHENTICATION_USE_HAS, false)) {
++ login = newLoginContext(HadoopConfiguration.HAS_KERBEROS_CONFIG_NAME,
++ subject, new HadoopConfiguration());
++ } else {
++ login = newLoginContext(authenticationMethod.getLoginAppName(),
++ subject, new HadoopConfiguration());
++ }
++
+ login.login();
+ UserGroupInformation realUser = new UserGroupInformation(subject);
+ realUser.setLogin(login);