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/05/06 03:53:06 UTC

[GitHub] [hadoop-ozone] Simon0806 removed a comment on pull request #897: HDDS-3513. add ozone-site.xml by default

Simon0806 removed a comment on pull request #897:
URL: https://github.com/apache/hadoop-ozone/pull/897#issuecomment-624428184


   I have make another patch to add OzoneConfiguration to UGI when start Gateway.
   Do you think this is feasible ? 
   `diff --git a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/Gateway.java b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/Gateway.java
   index 5d34181d6..467dd7107 100644
   --- a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/Gateway.java
   +++ b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/Gateway.java
   @@ -24,6 +24,8 @@
    import org.apache.hadoop.hdds.conf.OzoneConfiguration;
    import org.apache.hadoop.hdds.tracing.TracingUtil;
   
   +import org.apache.hadoop.security.SecurityUtil;
   +import org.apache.hadoop.security.UserGroupInformation;
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    import picocli.CommandLine.Command;
   @@ -51,6 +53,11 @@ public Void call() throws Exception {
        TracingUtil.initTracing("S3gateway", ozoneConfiguration);
        OzoneConfigurationHolder.setConfiguration(ozoneConfiguration);
        ozoneConfiguration.set("hadoop.http.authentication.type", "simple");
   +    if (SecurityUtil.getAuthenticationMethod(ozoneConfiguration).equals(
   +      UserGroupInformation.AuthenticationMethod.KERBEROS)){
   +      UserGroupInformation.setConfiguration(ozoneConfiguration);
   +    }
   +
        httpServer = new S3GatewayHttpServer(ozoneConfiguration, "s3gateway");
        start();
        return null;`


----------------------------------------------------------------
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



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