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 9fe090cb3b..0c1a52f627 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 @@ private OzoneManager(OzoneConfiguration conf) throws IOException, // 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 @@ private void readKeyPair() throws OzoneSecurityException { * @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 @@ private static OzoneManager createOm(String[] argv, } securityEnabled = OzoneSecurityUtil.isSecurityEnabled(conf); + if (securityEnabled) { + loginOMUser(conf); + } switch (startOpt) { case INIT: