YARN-6072. RM unable to start in secure mode. Contributed by Ajith S.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/a6b06f71 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/a6b06f71 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/a6b06f71 Branch: refs/heads/YARN-5734 Commit: a6b06f71797ad1ed9edbcef279bcf7d9e569f955 Parents: e6f13fe Author: Naganarasimha <naganarasimha...@apache.org> Authored: Thu Jan 12 06:40:41 2017 +0530 Committer: Naganarasimha <naganarasimha...@apache.org> Committed: Thu Jan 12 06:40:41 2017 +0530 ---------------------------------------------------------------------- .../server/resourcemanager/AdminService.java | 2 +- .../server/resourcemanager/ResourceManager.java | 26 +++++++++++++------- 2 files changed, 18 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/a6b06f71/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/AdminService.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/AdminService.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/AdminService.java index 04ee5d8..86bb896 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/AdminService.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/AdminService.java @@ -708,7 +708,7 @@ public class AdminService extends CompositeService implements } refreshClusterMaxPriority(); } catch (Exception ex) { - throw new ServiceFailedException(ex.getMessage()); + throw new ServiceFailedException("RefreshAll operation failed", ex); } } http://git-wip-us.apache.org/repos/asf/hadoop/blob/a6b06f71/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java ---------------------------------------------------------------------- diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java index 0c9d095..886f4ab 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java @@ -272,15 +272,6 @@ public class ResourceManager extends CompositeService implements Recoverable { this.rmContext.setHAEnabled(HAUtil.isHAEnabled(this.conf)); if (this.rmContext.isHAEnabled()) { 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 @@ -298,10 +289,27 @@ public class ResourceManager extends CompositeService implements Recoverable { addIfService(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(); addService(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); createAndInitActiveServices(false); --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org