Support Questions

Find answers, ask questions, and share your expertise

Unable to connect to HiveServer2 from JMeter using Kerberos

avatar
Explorer

I am trying to connect to HiveServer2 from JMeter over Kerberos. These are the two articles I have used: https://community.hortonworks.com/articles/60580/jmeter-setup-for-hive-load-testing-draft.html https://www.blazemeter.com/blog/windows-authentication-apache-jmeter

And this is the JMeter command I am using: JVM_ARGS="-Xms1024m -Xmx1024m" bin/jmeter -Dsun.security.krb5.debug=true -Djava.security.krb5.conf=/path/to/krb5.conf -Djava.security.auth.login.config=/path/to/jaas.conf -n -t test_plan.jmx -l results -e -o output

But for some reason, it is not picking the keytab information from the jaas.conf file and so I could not get the connection over Kerberos.

1 ACCEPTED SOLUTION

avatar
Super Guru

@KUMAR PEDDIBHOTLA

a) I assume that you use a hive user keytab in jaas.conf and you tested hive access from command line successfully. That is the must do first step. Make sure that you have a valid ticket (kinit, klist etc.). See documentation on docs.hortonworks.com for Hive and Kerberos.

b) There are 2 files under /bin folder of the JMeter installation which are used for Kerberos configuration:

  • krb5.conf - file of .ini format which contains Kerberos configuration details
  • jaas.conf - file which holds configuration details of Java Authentication and Authorization service

These files aren’t being used by default, so you have to tell JMeter where they are via system properties such as:

  • -Djava.security.krb5.conf=krb5.conf
  • -Djava.security.auth.login.config=jaas.conf

Alternatively you can add the next two lines to the system.properties file which is located at the same /bin folder.

  • java.security.krb5.conf=krb5.conf
  • java.security.auth.login.config=jaas.conf

I suggest using full paths to files.

c) Enable debug by adding the following to your command

-Djava.security.debug=gssloginconfig,configfile,configparser,logincontext

d) Check jmeter.log to see whether all properties are set as expected and map to existent file paths.

e) Turn off subject credentials:

-Djavax.security.auth.useSubjectCredsOnly=false

View solution in original post

3 REPLIES 3

avatar
Super Guru

@KUMAR PEDDIBHOTLA

a) I assume that you use a hive user keytab in jaas.conf and you tested hive access from command line successfully. That is the must do first step. Make sure that you have a valid ticket (kinit, klist etc.). See documentation on docs.hortonworks.com for Hive and Kerberos.

b) There are 2 files under /bin folder of the JMeter installation which are used for Kerberos configuration:

  • krb5.conf - file of .ini format which contains Kerberos configuration details
  • jaas.conf - file which holds configuration details of Java Authentication and Authorization service

These files aren’t being used by default, so you have to tell JMeter where they are via system properties such as:

  • -Djava.security.krb5.conf=krb5.conf
  • -Djava.security.auth.login.config=jaas.conf

Alternatively you can add the next two lines to the system.properties file which is located at the same /bin folder.

  • java.security.krb5.conf=krb5.conf
  • java.security.auth.login.config=jaas.conf

I suggest using full paths to files.

c) Enable debug by adding the following to your command

-Djava.security.debug=gssloginconfig,configfile,configparser,logincontext

d) Check jmeter.log to see whether all properties are set as expected and map to existent file paths.

e) Turn off subject credentials:

-Djavax.security.auth.useSubjectCredsOnly=false

avatar
Explorer

Yes, Constantin. I am using the Hive user keytab and have a valid Kerberos ticket for this user. Also, I have uncommented the lines related to krb5.conf and jaas.conf paths in the bin/system.properties. I have also provided the full paths to these files in the jmeter command.

But adding the -Djavax.security.auth.useSubjectCredsOnly=false did the trick. Now it is correctly picking up the principal/keytab information from the jaas.conf.

Thanks a lot for the quick repsonse, @Constantin Stanca. I have been working on this for more than one week. This is my final jmeter command that worked for me:

JVM_ARGS="-Xms1024m -Xmx1024m" bin/jmeter -Dsun.security.krb5.debug=true -Djavax.security.auth.useSubjectCredsOnly=false -Djava.security.debug=gssloginconfig,configfile,configparser,logincontext -Djava.security.krb5.conf=/path/to/krb5.conf -Djava.security.auth.login.config=/path/to/jaas.conf -n -t t1.jmx -l results -e -o output

Thank you,

Kumar

avatar
Explorer

Hello!

I have a issue with hive2 connection pool using Jmeter.I run a test and the errors allways is "JDBC connection pool "

NB: I added all the jars in lib/ext

Any suggesion

Thank you,

Nisrine