Skip to content

Commit

Permalink
LIHADOOP-21247: Azkaban Kerberos credentials are not being periodical…
Browse files Browse the repository at this point in the history
…ly refreshed in HadoopSecurityManager_H_2_0
  • Loading branch information
Anthony Hsu committed Jul 25, 2016
1 parent a4674be commit 4d80a4c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
*.iml
*.sublime-*
*.swp
.classpath
.idea/
.project
.settings
/bin
azkaban-hadoopsecuritymanager-*.jar
azkaban-jobtype-*.jar
azkaban-pigvisualizer-*.jar
/bin
.classpath
dist/
.project
.settings
*.sublime-*
*.swp
out/
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package azkaban.security.commons;

import java.io.File;
import java.io.IOException;
import java.util.Properties;

import org.apache.hadoop.fs.FileSystem;
Expand Down Expand Up @@ -46,6 +47,13 @@ public boolean isHadoopSecurityEnabled()
return false;
}

public void reloginFromKeytab() throws IOException {
UserGroupInformation ugi = UserGroupInformation.getLoginUser();
if (ugi.isFromKeytab()){
ugi.checkTGTAndReloginFromKeytab();
}
}

/**
* Create a proxied user based on the explicit user name, taking other
* parameters necessary from properties file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ public static HadoopSecurityManager getInstance(Props props)
}
}
}

logger.debug("Relogging in from keytab if necessary.");
hsmInstance.reloginFromKeytab();

return hsmInstance;
}

Expand Down

0 comments on commit 4d80a4c

Please sign in to comment.