diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java index 9fe090cb3bd..0c1a52f6276 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java @@ -255,11 +255,6 @@ public final class OzoneManager extends ServiceRuntimeInfoImpl // Load HA related configurations loadOMHAConfigs(configuration); - // Authenticate KSM if security is enabled - if (securityEnabled) { - loginOMUser(configuration); - } - if (!testSecureOmFlag || !isOzoneSecurityEnabled()) { scmContainerClient = getScmContainerClient(configuration); // verifies that the SCM info in the OM Version file is correct. @@ -652,7 +647,7 @@ public final class OzoneManager extends ServiceRuntimeInfoImpl * @param conf * @throws IOException, AuthenticationException */ - private void loginOMUser(OzoneConfiguration conf) + private static void loginOMUser(OzoneConfiguration conf) throws IOException, AuthenticationException { if (SecurityUtil.getAuthenticationMethod(conf).equals( @@ -833,6 +828,9 @@ public final class OzoneManager extends ServiceRuntimeInfoImpl } securityEnabled = OzoneSecurityUtil.isSecurityEnabled(conf); + if (securityEnabled) { + loginOMUser(conf); + } switch (startOpt) { case INIT: