init certificateLocalizationService before containerManager in NodeManager
@@ -476,6 +476,17 @@ protected void serviceInit(Configuration conf) throws Exception {
addService(nodeResourceMonitor);
((NMContext) context).setNodeResourceMonitor(nodeResourceMonitor);
+ if (conf.getBoolean(CommonConfigurationKeysPublic.IPC_SERVER_SSL_ENABLED,
+ CommonConfigurationKeysPublic.IPC_SERVER_SSL_ENABLED_DEFAULT)
+ || conf.getBoolean(YarnConfiguration.RM_JWT_ENABLED,
+ YarnConfiguration.DEFAULT_RM_JWT_ENABLED)) {
+ certificateLocalizationService = new CertificateLocalizationService(CertificateLocalizationService.ServiceType.NM);
+ CertificateLocalizationCtx.getInstance().setCertificateLocalization
+ (certificateLocalizationService);
+ addService(certificateLocalizationService);
+ ((NMContext) context).setCertificateLocalizationService(certificateLocalizationService);
+ }
+
containerManager =
createContainerManager(context, exec, del, nodeStatusUpdater,
this.aclsManager, dirsHandler);
@@ -512,17 +523,6 @@ protected void serviceInit(Configuration conf) throws Exception {
addService(nmCollectorService);
}
- if (conf.getBoolean(CommonConfigurationKeysPublic.IPC_SERVER_SSL_ENABLED,
- CommonConfigurationKeysPublic.IPC_SERVER_SSL_ENABLED_DEFAULT)
- || conf.getBoolean(YarnConfiguration.RM_JWT_ENABLED,
- YarnConfiguration.DEFAULT_RM_JWT_ENABLED)) {
- certificateLocalizationService = new CertificateLocalizationService(CertificateLocalizationService.ServiceType.NM);
- CertificateLocalizationCtx.getInstance().setCertificateLocalization
- (certificateLocalizationService);
- addService(certificateLocalizationService);
- ((NMContext) context).setCertificateLocalizationService(certificateLocalizationService);
- }
-
// StatusUpdater should be added last so that it get started last
// so that we make sure everything is up before registering with RM.
addService(nodeStatusUpdater);
