Closed branky closed 10 years ago
Token (HBASE_AUTH_TOKEN) has to be obtained during job submission:
// These 2 line of code need in Cascading client application
UserGroupInformation user = UserGroupInformation.getCurrentUser();
TokenUtil.obtainAndCacheToken(conf, user);
Due to unkown issue, this token is not in token list of Job Configuration’s credentials. Luckily, it can be retrieved from current user’s UserGroupInformation.
Credentials credentials = conf.getCredentials();
for (Token t : UserGroupInformation.getCurrentUser().getTokens()) {
if (t.getKind == HBASE_AUTH_TOKEN)
credentials.addToken(new Text(“HBASE_AUTH_TOKEN"), t);
}
Thanks for the patch! Could you send me the signed copy of the CCA, which I sent you yesterday? Thanks!
I am not sure, if I understand your comment above: If I merge this in, does the HBaseTap handle everything by iteself or does a user have to do some extra work before? If the latter is the case, we have to 1) document that and 2) I have to make sure, it also works with the lingual provider. Can you elaborate on that please?
Yes, as I mentioned, "Token (HBASE_AUTH_TOKEN) has to be obtained during job submission", below has to be added in user's code.
if (User.isHBaseSecurityEnabled(conf)) {
TokenUtil.obtainAndCacheToken(conf, UserGroupInformation.getCurrentUser());
}
I see. We really need to add a test with a secure cluster. Do you know if the test cluster can be made to act like one?
I have been using this patch in our internal cluster. Kerberos authentication really introduces complexity. HBase's own security tests may be helpful for reference. https://github.com/apache/hbase/tree/0.94/security/src/test/java/org/apache/hadoop/hbase
Could you add a little paragraph to the README explaining this usage, so that it does not get buried in this pull request. Thanks!
Within a secured Hadoop cluster (Kerberos authentication enabled), just like delegation tokens are required to access HDFS data and run MapReduce jobs, a token is also need to interact with HBase.
Current implementation of HBaseTap doesn't handle token, read and write data from/to will get exceptions: