YARN-7765. Fixed an issue that kerberos tgt not found when NM posting timeline events. Contributed by Rohith Sharma K S

This commit is contained in:
Jian He 2018-01-27 22:18:51 -08:00
parent 649ef7ac33
commit 443523f9c0
3 changed files with 10 additions and 7 deletions

View File

@ -454,18 +454,15 @@ protected void serviceInit(Configuration conf) throws Exception {
((NMContext) context).setNodeStatusUpdater(nodeStatusUpdater);
nmStore.setNodeStatusUpdater(nodeStatusUpdater);
super.serviceInit(conf);
// TODO add local dirs to del
}
@Override
protected void serviceStart() throws Exception {
// Do secure login before calling init for added services.
try {
doSecureLogin();
} catch (IOException e) {
throw new YarnRuntimeException("Failed NodeManager login", e);
}
super.serviceStart();
super.serviceInit(conf);
// TODO add local dirs to del
}
@Override

View File

@ -100,6 +100,7 @@ protected void serviceInit(Configuration conf) throws Exception {
this.nmLoginUGI = UserGroupInformation.isSecurityEnabled() ?
UserGroupInformation.getLoginUser() :
UserGroupInformation.getCurrentUser();
LOG.info("Initialized NMTimelinePublisher UGI to " + nmLoginUGI);
super.serviceInit(conf);
}

View File

@ -129,6 +129,11 @@ protected void serviceInit(Configuration conf) throws Exception {
new FlowActivityTable().getTableMutator(hbaseConf, conn);
subApplicationTable =
new SubApplicationTable().getTableMutator(hbaseConf, conn);
UserGroupInformation ugi = UserGroupInformation.isSecurityEnabled() ?
UserGroupInformation.getLoginUser() :
UserGroupInformation.getCurrentUser();
LOG.info("Initialized HBaseTimelineWriterImpl UGI to " + ugi);
}
/**