How to access secure kerberized hadoop using just java API How to access secure kerberized hadoop using just java API hadoop hadoop

How to access secure kerberized hadoop using just java API


If you have a keytab file for the identity of the UserGroupInformation superuser, you can use the org.apache.hadoop.security.SecurityUtil#login(…) API offered in the hadoop-common library, to log in directly from your code. The full API can be found here.

This will need to be done before you create the remote user (or more generally, before any socket connection of any form can be made to the various service daemons), as the invocation would otherwise fail with no login credentials being found.

You do not need krb5-workstation packages and utilities installed or available on the execution machine for this to work.


I had similar issue. I'll just put what I could not find easily in docs.

Ensure your site XML files are in your classpath.