mirror of https://github.com/apache/druid.git
Fix ClassNotFoundException in druid-kerberos extension (#4776)
Class org.apache.hadoop.conf.Configuration inside extensions should be used with caution. By default, the configuration uses the context class loader of the current thread set to the class loader used to load the application. Because of isolation between the application and extensions we must explicitely set the class loader to extension class loader to be able load classes specified in hadoop configuration file.
This commit is contained in:
parent
331a0afb98
commit
b0ecfee1ab
|
@ -95,6 +95,7 @@ public class DruidKerberosUtil
|
|||
{
|
||||
if (!Strings.isNullOrEmpty(internalClientPrincipal) && !Strings.isNullOrEmpty(internalClientKeytab)) {
|
||||
Configuration conf = new Configuration();
|
||||
conf.setClassLoader(DruidKerberosModule.class.getClassLoader());
|
||||
conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION, "kerberos");
|
||||
UserGroupInformation.setConfiguration(conf);
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue