Simon0806 commented 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:
us...@infra.apache.org



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

Reply via email to