From e0fe3d1ecaf859d0bf1a5b5223c4b2a56bfcde0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Elek?= Date: Fri, 15 Feb 2019 16:09:37 +0100 Subject: [PATCH] HDDS-1110. OzoneManager need to login during init when security is enabled. Contributed by Xiaoyu Yao. --- .../java/org/apache/hadoop/ozone/om/OzoneManager.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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: