YARN-4938. MiniYarnCluster should not request transitionToActive to RM on non-HA environment. Contributed by Eric Badger.

(cherry picked from commit 1b78b2ba17cffdd19ae056555dd7f89b7a3eb06a)
This commit is contained in:
Akira Ajisaka 2016-04-11 01:31:49 +09:00
parent 17c4f34b3d
commit 88556294e2

View File

@ -462,7 +462,7 @@ protected synchronized void serviceInit(Configuration conf)
@Override
protected synchronized void serviceStart() throws Exception {
startResourceManager(index);
if(index == 0) {
if(index == 0 && resourceManagers[index].getRMContext().isHAEnabled()) {
resourceManagers[index].getRMContext().getRMAdminService()
.transitionToActive(new HAServiceProtocol.StateChangeRequestInfo(
HAServiceProtocol.RequestSource.REQUEST_BY_USER_FORCED));