Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Hive Server 2 - LoginException: Unsupported authentication type KERBEROS

avatar
New Contributor

Hi ,

Hadoop version - 2.9.2

Apache hive - 2.3.5

Operating system - Windows10

I installed Hadoop and hive in my Windows machine and it works fine for NOSASL (hive site.xml)

<property>
<name>hive.server2.authentication</name>
<value>NOSASL</value>
</property>

 

But when I tried with KERBEROS  , could not start hive service2

ERROR

-------------

javax.security.auth.login.LoginException: Unsupported authentication type KERBEROS
at org.apache.hive.service.auth.HiveAuthFactory.getAuthTransFactory(HiveAuthFactory.java:184) ~[hive-service-2.3.5.jar:2.3.5]
at org.apache.hive.service.cli.thrift.ThriftBinaryCLIService.run(ThriftBinaryCLIService.java:70) ~[hive-service-2.3.5.jar:2.3.5]at java.lang.Thread.run(Thread.java:748) [?:1.8.0_261]

 

I just followed the cloudera official documents to enable KERBEROS  
steps 

--------

1. installed KERBEROS   in windows 10

2. set the KRB5CCNAME  environment variable.

3. updated hive site.xml file

<property>
<name>hive.server2.authentication</name>
<value>KERBEROS</value>
</property>
<property>
<name>hive.server2.authentication.kerberos.principal</name>
<value>hive/_host@your-realm.com</value>
</property>
<property>
<name>hive.server2.authentication.kerberos.keytab</name>
<value>path of  krb5.keytab</value>
</property>

6 REPLIES 6

avatar
Expert Contributor
@RatheeshNote Can you update the hive site.xml as below. (note the kerberos is in small letters) Also accordingly edit the hive.server2.authentication.kerberos.principal value.
  <property>
    <name>hive.server2.authentication</name>
    <value>kerberos</value>
  </property>
  <property>
    <name>hive.server2.authentication.kerberos.principal</name>
    <value>hive/<fqdn-hostname>@<REALM.NAME></value>
  </property>

 

avatar
New Contributor

Thank you @tusharkathpal , I updated hive site.xml , but issue is still  not resolved.

javax.security.auth.login.LoginException: Unsupported authentication type kerberos
at org.apache.hive.service.auth.HiveAuthFactory.getAuthTransFactory(HiveAuthFactory.java:184) ~[hive-service-2.3.5.jar:2.3.5]

avatar
New Contributor

did you resolve the issue? I'm facing the same.

avatar
New Contributor

I encountered the same problem. Has your problem been solved?

 

2020-12-17T18:09:45,274 INFO  [main]: server.HiveServer2 (HiveServer2.java:stop(913)) - Shutting down HiveServer2
2020-12-17T18:09:45,274 INFO  [main]: server.HiveServer2 (HiveServer2.java:stop(925)) - Web UI has stopped
2020-12-17T18:09:45,276 ERROR [main]: server.HiveServer2 (HiveServer2.java:stop(944)) - Error removing znode for this HiveServer2 instance from ZooKeeper.
java.lang.NullPointerException: null
	at org.apache.hive.service.server.HiveServer2.removeServerInstanceFromZooKeeper(HiveServer2.java:677) ~[hive-service-3.1.0.3.0.1.0-187.jar:3.1.0.3.0.1.0-187]
	at org.apache.hive.service.server.HiveServer2.stop(HiveServer2.java:942) [hive-service-3.1.0.3.0.1.0-187.jar:3.1.0.3.0.1.0-187]
	at org.apache.hive.service.server.HiveServer2.startHiveServer2(HiveServer2.java:1090) [hive-service-3.1.0.3.0.1.0-187.jar:3.1.0.3.0.1.0-187]
	at org.apache.hive.service.server.HiveServer2.access$1700(HiveServer2.java:135) [hive-service-3.1.0.3.0.1.0-187.jar:3.1.0.3.0.1.0-187]
	at org.apache.hive.service.server.HiveServer2$StartOptionExecutor.execute(HiveServer2.java:1341) [hive-service-3.1.0.3.0.1.0-187.jar:3.1.0.3.0.1.0-187]
	at org.apache.hive.service.server.HiveServer2.main(HiveServer2.java:1185) [hive-service-3.1.0.3.0.1.0-187.jar:3.1.0.3.0.1.0-187]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_241]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_241]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_241]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_241]
	at org.apache.hadoop.util.RunJar.run(RunJar.java:318) [hadoop-common-3.1.1.3.0.1.0-187.jar:?]
	at org.apache.hadoop.util.RunJar.main(RunJar.java:232) [hadoop-common-3.1.1.3.0.1.0-187.jar:?]
2020-12-17T18:09:45,276 INFO  [main]: server.HiveServer2 (HiveServer2.java:stopOrDisconnectTezSessions(890)) - Stopping/Disconnecting tez sessions.
2020-12-17T18:09:45,276 WARN  [main]: server.HiveServer2 (HiveServer2.java:startHiveServer2(1100)) - Error starting HiveServer2 on attempt 1, will retry in 60000ms
org.apache.hive.service.ServiceException: Failed to Start HiveServer2
	at org.apache.hive.service.CompositeService.start(CompositeService.java:80) ~[hive-service-3.1.0.3.0.1.0-187.jar:3.1.0.3.0.1.0-187]
	at org.apache.hive.service.server.HiveServer2.start(HiveServer2.java:706) ~[hive-service-3.1.0.3.0.1.0-187.jar:3.1.0.3.0.1.0-187]
	at org.apache.hive.service.server.HiveServer2.startHiveServer2(HiveServer2.java:1073) [hive-service-3.1.0.3.0.1.0-187.jar:3.1.0.3.0.1.0-187]
	at org.apache.hive.service.server.HiveServer2.access$1700(HiveServer2.java:135) [hive-service-3.1.0.3.0.1.0-187.jar:3.1.0.3.0.1.0-187]
	at org.apache.hive.service.server.HiveServer2$StartOptionExecutor.execute(HiveServer2.java:1341) [hive-service-3.1.0.3.0.1.0-187.jar:3.1.0.3.0.1.0-187]
	at org.apache.hive.service.server.HiveServer2.main(HiveServer2.java:1185) [hive-service-3.1.0.3.0.1.0-187.jar:3.1.0.3.0.1.0-187]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_241]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_241]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_241]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_241]
	at org.apache.hadoop.util.RunJar.run(RunJar.java:318) [hadoop-common-3.1.1.3.0.1.0-187.jar:?]
	at org.apache.hadoop.util.RunJar.main(RunJar.java:232) [hadoop-common-3.1.1.3.0.1.0-187.jar:?]
Caused by: java.lang.RuntimeException: Failed to init thrift server
	at org.apache.hive.service.cli.thrift.ThriftBinaryCLIService.initServer(ThriftBinaryCLIService.java:162) ~[hive-service-3.1.0.3.0.1.0-187.jar:3.1.0.3.0.1.0-187]
	at org.apache.hive.service.cli.thrift.ThriftCLIService.start(ThriftCLIService.java:216) ~[hive-service-3.1.0.3.0.1.0-187.jar:3.1.0.3.0.1.0-187]
	at org.apache.hive.service.CompositeService.start(CompositeService.java:70) ~[hive-service-3.1.0.3.0.1.0-187.jar:3.1.0.3.0.1.0-187]
	... 11 more
Caused by: javax.security.auth.login.LoginException: Unsupported authentication type KERBEROS
	at org.apache.hive.service.auth.HiveAuthFactory.getAuthTransFactory(HiveAuthFactory.java:168) ~[hive-service-3.1.0.3.0.1.0-187.jar:3.1.0.3.0.1.0-187]
	at org.apache.hive.service.cli.thrift.ThriftBinaryCLIService.initServer(ThriftBinaryCLIService.java:72) ~[hive-service-3.1.0.3.0.1.0-187.jar:3.1.0.3.0.1.0-187]
	at org.apache.hive.service.cli.thrift.ThriftCLIService.start(ThriftCLIService.java:216) ~[hive-service-3.1.0.3.0.1.0-187.jar:3.1.0.3.0.1.0-187]
	at org.apache.hive.service.CompositeService.start(CompositeService.java:70) ~[hive-service-3.1.0.3.0.1.0-187.jar:3.1.0.3.0.1.0-187]
	... 11 more

avatar
New Contributor

I've encounted the same issue. My Hadoop version is 3.1.0 and my Hive version is 3.1.3. I've  installed the hadoop in pseudo cluster mode and setup hive with few hive-site properties ( such authentication type, keytab, principal, etc). 
However the NONE authentication mode worked just fine. 

 

avatar
Community Manager

@Azusaings As this is an older post, you would have a better chance of receiving a resolution by starting a new thread. This will also be an opportunity to provide details specific to your environment that could aid others in assisting you with a more accurate answer to your question. You can link this thread as a reference in your new post. Thanks.


Regards,

Diana Torres,
Community Moderator


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community: