You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/02/28 18:59:11 UTC

[GitHub] [hadoop-ozone] xiaoyuyao commented on a change in pull request #615: HDDS-3085. OM Delta updates request in Recon should work with secure Ozone Manager.

xiaoyuyao commented on a change in pull request #615: HDDS-3085. OM Delta updates request in Recon should work with secure Ozone Manager.
URL: https://github.com/apache/hadoop-ozone/pull/615#discussion_r385867260
 
 

 ##########
 File path: hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconServer.java
 ##########
 @@ -144,6 +155,50 @@ public void join() {
     }
   }
 
+  /**
+   * Logs in the Recon user if security is enabled in the configuration.
+   *
+   * @param conf OzoneConfiguration
+   * @throws IOException, AuthenticationException in case login fails.
+   */
+  private static void loginReconUserIfSecurityEnabled(OzoneConfiguration  conf)
+      throws IOException, AuthenticationException {
+    if (OzoneSecurityUtil.isSecurityEnabled(conf)) {
+      loginReconUser(conf);
+    }
+  }
+
+  /**
+   * Login Recon service user if security is enabled.
+   *
+   * @param  conf OzoneConfiguration
+   * @throws IOException, AuthenticationException
+   */
+  private static void loginReconUser(OzoneConfiguration conf)
+      throws IOException, AuthenticationException {
+
+    if (SecurityUtil.getAuthenticationMethod(conf).equals(
+        UserGroupInformation.AuthenticationMethod.KERBEROS)) {
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("Ozone security is enabled. Attempting login for Recon user. "
 
 Review comment:
   NIT: this can be a LOG.info() like many other hadoop daemons. It can help identifying misconfigured principal/keytab. .

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org