[BUG] Throw exception when create file.
When kerberos startup, create file fail, throw exception:
Caused by: org.apache.hadoop.security.AccessControlException: Client cannot authenticate via:[TOKEN, KERBEROS]
Of course, kerberos config is well.
Temporary solution is to leave parameter 'hdfs.root.user' blank.
@qiaozhanwei
Temporary solution is to leave parameter 'hdfs.root.user' blank.
this is the right way to solve this problem, next version will solve this problem from code
Temporary solution is to leave parameter 'hdfs.root.user' blank.
this is the right way to solve this problem, next version will solve this problem from code
Could you tell me how to solve this problem?
you can see the code HadoopUtils.java
init method:
if (fs == null) {
if(StringUtils.isNotEmpty(hdfsUser)){
//UserGroupInformation ugi = UserGroupInformation.createProxyUser(hdfsUser,UserGroupInformation.getLoginUser());
UserGroupInformation ugi = UserGroupInformation.createRemoteUser(hdfsUser);
ugi.doAs(new PrivilegedExceptionAction<Boolean>() {
@Override
public Boolean run() throws Exception {
fs = FileSystem.get(configuration);
return true;
}
});
}else{
logger.warn("hdfs.root.user is not set value!");
fs = FileSystem.get(configuration);
}
}