Repository: hadoop Updated Branches: refs/heads/branch-2.8.0 141837fbc -> e94a2bcfa
YARN-6072. RM unable to start in secure mode. Contributed by Ajith S. (cherry picked from commit e459092a08933ea8637a2f37fbae0d9875e6870d) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/e94a2bcf Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/e94a2bcf Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/e94a2bcf Branch: refs/heads/branch-2.8.0 Commit: e94a2bcfa82be0e24a49585b50dfdd0c3dfeb2e7 Parents: 141837f Author: Naganarasimha <naganarasimha...@apache.org> Authored: Thu Jan 12 10:14:39 2017 +0530 Committer: Junping Du <junping...@apache.org> Committed: Thu Jan 12 14:35:51 2017 -0800 ---------------------------------------------------------------------- .../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/e94a2bcf/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 37cb76b..c3a9aad 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 @@ -673,7 +673,7 @@ public class AdminService extends CompositeService implements } refreshClusterMaxPriority(RefreshClusterMaxPriorityRequest.newInstance()); } 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/e94a2bcf/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 7b1f2f9..469db2a 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 @@ -252,15 +252,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 @@ -278,10 +269,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(); --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org