YARN-6072. RM unable to start in secure mode. Contributed by Ajith S.
(cherry picked from commit a6b06f7179
)
This commit is contained in:
parent
718ae2d477
commit
4bd05840fc
|
@ -708,7 +708,7 @@ public class AdminService extends CompositeService implements
|
||||||
}
|
}
|
||||||
refreshClusterMaxPriority();
|
refreshClusterMaxPriority();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
throw new ServiceFailedException(ex.getMessage());
|
throw new ServiceFailedException("RefreshAll operation failed", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -256,15 +256,6 @@ public class ResourceManager extends CompositeService implements Recoverable {
|
||||||
this.rmContext.setHAEnabled(HAUtil.isHAEnabled(this.conf));
|
this.rmContext.setHAEnabled(HAUtil.isHAEnabled(this.conf));
|
||||||
if (this.rmContext.isHAEnabled()) {
|
if (this.rmContext.isHAEnabled()) {
|
||||||
HAUtil.verifyAndSetConfiguration(this.conf);
|
HAUtil.verifyAndSetConfiguration(this.conf);
|
||||||
|
|
||||||
// If the RM is configured to use an embedded leader elector,
|
|
||||||
// initialize the leader elector.
|
|
||||||
if (HAUtil.isAutomaticFailoverEnabled(conf) &&
|
|
||||||
HAUtil.isAutomaticFailoverEmbedded(conf)) {
|
|
||||||
EmbeddedElector elector = createEmbeddedElector();
|
|
||||||
addIfService(elector);
|
|
||||||
rmContext.setLeaderElectorService(elector);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set UGI and do login
|
// Set UGI and do login
|
||||||
|
@ -282,10 +273,27 @@ public class ResourceManager extends CompositeService implements Recoverable {
|
||||||
addIfService(rmDispatcher);
|
addIfService(rmDispatcher);
|
||||||
rmContext.setDispatcher(rmDispatcher);
|
rmContext.setDispatcher(rmDispatcher);
|
||||||
|
|
||||||
|
// The order of services below should not be changed as services will be
|
||||||
|
// started in same order
|
||||||
|
// As elector service needs admin service to be initialized and started,
|
||||||
|
// first we add admin service then elector service
|
||||||
|
|
||||||
adminService = createAdminService();
|
adminService = createAdminService();
|
||||||
addService(adminService);
|
addService(adminService);
|
||||||
rmContext.setRMAdminService(adminService);
|
rmContext.setRMAdminService(adminService);
|
||||||
|
|
||||||
|
// elector must be added post adminservice
|
||||||
|
if (this.rmContext.isHAEnabled()) {
|
||||||
|
// If the RM is configured to use an embedded leader elector,
|
||||||
|
// initialize the leader elector.
|
||||||
|
if (HAUtil.isAutomaticFailoverEnabled(conf)
|
||||||
|
&& HAUtil.isAutomaticFailoverEmbedded(conf)) {
|
||||||
|
EmbeddedElector elector = createEmbeddedElector();
|
||||||
|
addIfService(elector);
|
||||||
|
rmContext.setLeaderElectorService(elector);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rmContext.setYarnConfiguration(conf);
|
rmContext.setYarnConfiguration(conf);
|
||||||
|
|
||||||
createAndInitActiveServices(false);
|
createAndInitActiveServices(false);
|
||||||
|
|
Loading…
Reference in New Issue