From e9e911464e0a755c5b893f498faede45e335165a Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Wed, 9 Apr 2025 13:19:45 +0200 Subject: [PATCH 1/9] HDDS-12805. Use slf4j for HttpRequestLog --- .../hdds/server/http/HttpRequestLog.java | 106 ------------------ .../server/http/HttpRequestLogAppender.java | 62 ---------- .../hadoop/hdds/server/http/HttpServer2.java | 22 ++-- .../hdds/server/http/TestHttpRequestLog.java | 51 --------- .../http/TestHttpRequestLogAppender.java | 40 ------- 5 files changed, 15 insertions(+), 266 deletions(-) delete mode 100644 hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/HttpRequestLog.java delete mode 100644 hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/HttpRequestLogAppender.java delete mode 100644 hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/server/http/TestHttpRequestLog.java delete mode 100644 hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/server/http/TestHttpRequestLogAppender.java diff --git a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/HttpRequestLog.java b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/HttpRequestLog.java deleted file mode 100644 index 28a85a9a67f3..000000000000 --- a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/HttpRequestLog.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.hadoop.hdds.server.http; - -import java.util.HashMap; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogConfigurationException; -import org.apache.commons.logging.LogFactory; -import org.apache.commons.logging.impl.Log4JLogger; -import org.apache.log4j.Appender; -import org.eclipse.jetty.server.AsyncRequestLogWriter; -import org.eclipse.jetty.server.CustomRequestLog; -import org.eclipse.jetty.server.RequestLog; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * RequestLog object for use with Http. - */ -public final class HttpRequestLog { - - public static final Logger LOG = - LoggerFactory.getLogger(HttpRequestLog.class); - private static final HashMap SERVER_TO_COMPONENT; - - private HttpRequestLog() { - } - - static { - SERVER_TO_COMPONENT = new HashMap(); - SERVER_TO_COMPONENT.put("cluster", "resourcemanager"); - SERVER_TO_COMPONENT.put("hdfs", "namenode"); - SERVER_TO_COMPONENT.put("node", "nodemanager"); - } - - public static RequestLog getRequestLog(String name) { - - String lookup = SERVER_TO_COMPONENT.get(name); - if (lookup != null) { - name = lookup; - } - String loggerName = "http.requests." + name; - String appenderName = name + "requestlog"; - Log logger = LogFactory.getLog(loggerName); - - boolean isLog4JLogger; - - try { - isLog4JLogger = logger instanceof Log4JLogger; - } catch (NoClassDefFoundError err) { - // In some dependent projects, log4j may not even be on the classpath at - // runtime, in which case the above instanceof check will throw - // NoClassDefFoundError. - LOG.debug("Could not load Log4JLogger class", err); - isLog4JLogger = false; - } - if (isLog4JLogger) { - Log4JLogger httpLog4JLog = (Log4JLogger) logger; - org.apache.log4j.Logger httpLogger = httpLog4JLog.getLogger(); - Appender appender = null; - - try { - appender = httpLogger.getAppender(appenderName); - } catch (LogConfigurationException e) { - LOG.warn("Http request log for {} could not be created", loggerName); - throw e; - } - - if (appender == null) { - LOG.info("Http request log for {} is not defined", loggerName); - return null; - } - - if (appender instanceof HttpRequestLogAppender) { - HttpRequestLogAppender requestLogAppender - = (HttpRequestLogAppender) appender; - AsyncRequestLogWriter logWriter = new AsyncRequestLogWriter(); - logWriter.setFilename(requestLogAppender.getFilename()); - logWriter.setRetainDays(requestLogAppender.getRetainDays()); - return new CustomRequestLog(logWriter, - CustomRequestLog.EXTENDED_NCSA_FORMAT); - } else { - LOG.warn("Jetty request log for {} was of the wrong class", loggerName); - return null; - } - } else { - LOG.warn("Jetty request log can only be enabled using Log4j"); - return null; - } - } -} diff --git a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/HttpRequestLogAppender.java b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/HttpRequestLogAppender.java deleted file mode 100644 index 9777e2d9b5d2..000000000000 --- a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/HttpRequestLogAppender.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.hadoop.hdds.server.http; - -import org.apache.log4j.AppenderSkeleton; -import org.apache.log4j.spi.LoggingEvent; - -/** - * Log4j Appender adapter for HttpRequestLog. - */ -public class HttpRequestLogAppender extends AppenderSkeleton { - - private String filename; - private int retainDays; - - public HttpRequestLogAppender() { - } - - public void setRetainDays(int retainDays) { - this.retainDays = retainDays; - } - - public int getRetainDays() { - return retainDays; - } - - public void setFilename(String filename) { - this.filename = filename; - } - - public String getFilename() { - return filename; - } - - @Override - public void append(LoggingEvent event) { - } - - @Override - public void close() { - } - - @Override - public boolean requiresLayout() { - return false; - } -} diff --git a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/HttpServer2.java b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/HttpServer2.java index 95bd458582a8..96413ae72e75 100644 --- a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/HttpServer2.java +++ b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/server/http/HttpServer2.java @@ -89,6 +89,7 @@ import org.eclipse.jetty.http.HttpVersion; import org.eclipse.jetty.server.ConnectionFactory; import org.eclipse.jetty.server.Connector; +import org.eclipse.jetty.server.CustomRequestLog; import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.HttpConfiguration; import org.eclipse.jetty.server.HttpConnectionFactory; @@ -96,6 +97,7 @@ import org.eclipse.jetty.server.SecureRequestCustomizer; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; +import org.eclipse.jetty.server.Slf4jRequestLogWriter; import org.eclipse.jetty.server.SslConnectionFactory; import org.eclipse.jetty.server.handler.ContextHandlerCollection; import org.eclipse.jetty.server.handler.HandlerCollection; @@ -618,14 +620,13 @@ private void initializeWebServer(Builder builder) throws IOException { handler.getSessionCookieConfig().setSecure(true); ContextHandlerCollection contexts = new ContextHandlerCollection(); - RequestLog requestLog = HttpRequestLog.getRequestLog(builder.name); - handlers.addHandler(contexts); - if (requestLog != null) { - RequestLogHandler requestLogHandler = new RequestLogHandler(); - requestLogHandler.setRequestLog(requestLog); - handlers.addHandler(requestLogHandler); - } + + RequestLog requestLog = getRequestLog(builder.name); + RequestLogHandler requestLogHandler = new RequestLogHandler(); + requestLogHandler.setRequestLog(requestLog); + handlers.addHandler(requestLogHandler); + handlers.addHandler(webAppContext); final String appDir = getWebAppsPath(builder.name); if (!builder.skipDefaultApps) { @@ -1794,4 +1795,11 @@ public static void setHttpBaseDir(OzoneConfiguration ozoneConfiguration) tmpMetaDir.getAbsolutePath()); } } + + private static RequestLog getRequestLog(String name) { + String loggerName = "http.requests." + name; + Slf4jRequestLogWriter writer = new Slf4jRequestLogWriter(); + writer.setLoggerName(loggerName); + return new CustomRequestLog(writer, CustomRequestLog.EXTENDED_NCSA_FORMAT); + } } diff --git a/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/server/http/TestHttpRequestLog.java b/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/server/http/TestHttpRequestLog.java deleted file mode 100644 index eb596acc7a68..000000000000 --- a/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/server/http/TestHttpRequestLog.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.hadoop.hdds.server.http; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; - -import org.apache.log4j.Logger; -import org.eclipse.jetty.server.CustomRequestLog; -import org.eclipse.jetty.server.RequestLog; -import org.junit.jupiter.api.Test; - -/** - * Testing HttpRequestLog. - */ -public class TestHttpRequestLog { - - @Test - public void testAppenderUndefined() { - RequestLog requestLog = HttpRequestLog.getRequestLog("test"); - assertNull(requestLog, "RequestLog should be null"); - } - - @Test - public void testAppenderDefined() { - HttpRequestLogAppender requestLogAppender = new HttpRequestLogAppender(); - requestLogAppender.setName("testrequestlog"); - Logger.getLogger("http.requests.test").addAppender(requestLogAppender); - RequestLog requestLog = HttpRequestLog.getRequestLog("test"); - Logger.getLogger("http.requests.test").removeAppender(requestLogAppender); - assertNotNull(requestLog, "RequestLog should not be null"); - assertEquals(CustomRequestLog.class, requestLog.getClass(), - "Class mismatch"); - } -} diff --git a/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/server/http/TestHttpRequestLogAppender.java b/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/server/http/TestHttpRequestLogAppender.java deleted file mode 100644 index 418f9215848f..000000000000 --- a/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/server/http/TestHttpRequestLogAppender.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.hadoop.hdds.server.http; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import org.junit.jupiter.api.Test; - -/** - * Test Http request log appender. - */ -public class TestHttpRequestLogAppender { - - @Test - public void testParameterPropagation() { - - HttpRequestLogAppender requestLogAppender = new HttpRequestLogAppender(); - requestLogAppender.setFilename("jetty-namenode-yyyy_mm_dd.log"); - requestLogAppender.setRetainDays(17); - assertEquals("jetty-namenode-yyyy_mm_dd.log", - requestLogAppender.getFilename(), "Filename mismatch"); - assertEquals(17, requestLogAppender.getRetainDays(), - "Retain days mismatch"); - } -} From df184038e50e41bddd37b8b2a152102e82763d29 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Thu, 10 Apr 2025 12:55:17 +0200 Subject: [PATCH 2/9] rename s3g-web to s3g-admin --- .../src/main/java/org/apache/hadoop/ozone/s3/Gateway.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 0f89284bf5da..8a35798619be 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 @@ -59,7 +59,7 @@ public class Gateway extends GenericCli implements Callable { private S3GatewayHttpServer httpServer; /** Servlets and static content on separate port. */ - private BaseHttpServer contentServer; + private BaseHttpServer adminHttpServer; private S3GatewayMetrics metrics; private final JvmPauseMonitor jvmPauseMonitor = newJvmPauseMonitor("S3G"); @@ -81,7 +81,7 @@ public Void call() throws Exception { loginS3GUser(OzoneConfigurationHolder.configuration()); setHttpBaseDir(OzoneConfigurationHolder.configuration()); httpServer = new S3GatewayHttpServer(OzoneConfigurationHolder.configuration(), "s3gateway"); - contentServer = new S3GatewayWebAdminServer(OzoneConfigurationHolder.configuration(), "s3g-web"); + adminHttpServer = new S3GatewayWebAdminServer(OzoneConfigurationHolder.configuration(), "s3g-admin"); metrics = S3GatewayMetrics.create(OzoneConfigurationHolder.configuration()); start(); @@ -105,13 +105,13 @@ public void start() throws IOException { HddsServerUtil.initializeMetrics(OzoneConfigurationHolder.configuration(), "S3Gateway"); jvmPauseMonitor.start(); httpServer.start(); - contentServer.start(); + adminHttpServer.start(); } public void stop() throws Exception { LOG.info("Stopping Ozone S3 gateway"); httpServer.stop(); - contentServer.stop(); + adminHttpServer.stop(); jvmPauseMonitor.stop(); S3GatewayMetrics.unRegister(); } From 4a1e8ff59787aeae635b66e9758a2634b923cc61 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Thu, 10 Apr 2025 12:55:31 +0200 Subject: [PATCH 3/9] rename webhdfs to httpfs --- .../org/apache/ozone/fs/http/server/HttpFSServerWebServer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/fs/http/server/HttpFSServerWebServer.java b/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/fs/http/server/HttpFSServerWebServer.java index 0b6cf06dbdce..3f872a766749 100644 --- a/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/fs/http/server/HttpFSServerWebServer.java +++ b/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/fs/http/server/HttpFSServerWebServer.java @@ -61,7 +61,7 @@ public class HttpFSServerWebServer { private static final String HTTP_ADMINS_KEY = "httpfs.http.administrators"; - private static final String NAME = "webhdfs"; + private static final String NAME = "httpfs"; private static final String SERVLET_PATH = "/webhdfs"; static { From 561dc8e1de657e3353ecac6a078a7b822f9726c2 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Thu, 10 Apr 2025 12:55:53 +0200 Subject: [PATCH 4/9] configure appender and logger for Ozone services --- .../dist/src/shell/conf/log4j.properties | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/hadoop-ozone/dist/src/shell/conf/log4j.properties b/hadoop-ozone/dist/src/shell/conf/log4j.properties index aa3d0b4bf43a..ce9e5d268d57 100644 --- a/hadoop-ozone/dist/src/shell/conf/log4j.properties +++ b/hadoop-ozone/dist/src/shell/conf/log4j.properties @@ -122,6 +122,25 @@ log4j.appender.DRFAS.layout=org.apache.log4j.PatternLayout log4j.appender.DRFAS.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n log4j.appender.DRFAS.DatePattern=.yyyy-MM-dd +# +# HTTP request logs +# +log4j.appender.HttpAccess=org.apache.log4j.DailyRollingFileAppender +log4j.appender.HttpAccess.File=${hadoop.log.dir}/access.log +log4j.appender.HttpAccess.DatePattern=.yyyy-MM-dd +log4j.appender.HttpAccess.layout=org.apache.log4j.PatternLayout +log4j.appender.HttpAccess.layout.ConversionPattern=%m%n + +log4j.additivity.http.requests=false +log4j.logger.http.requests=INFO,HttpAccess +# Create separate appender for each co-hosted component if needed, then enable distinct logger configs: +#log4j.logger.http.requests.hddsDatanode=INFO,HttpAccess +#log4j.logger.http.requests.httpfs=INFO,HttpAccess +#log4j.logger.http.requests.ozoneManager=INFO,HttpAccess +#log4j.logger.http.requests.recon=INFO,HttpAccess +#log4j.logger.http.requests.scm=INFO,HttpAccess +#log4j.logger.http.requests.s3gateway=INFO,HttpAccess +#log4j.logger.http.requests.s3g-admin=INFO,HttpAccess # Custom Logging levels # AWS SDK & S3A FileSystem From ec12791952e7e54f065445cb98ecafaea5fe9f15 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Thu, 10 Apr 2025 14:37:32 +0200 Subject: [PATCH 5/9] revert renaming s3g-web to s3g-admin --- .../src/main/java/org/apache/hadoop/ozone/s3/Gateway.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 8a35798619be..33965b4b159c 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 @@ -81,7 +81,7 @@ public Void call() throws Exception { loginS3GUser(OzoneConfigurationHolder.configuration()); setHttpBaseDir(OzoneConfigurationHolder.configuration()); httpServer = new S3GatewayHttpServer(OzoneConfigurationHolder.configuration(), "s3gateway"); - adminHttpServer = new S3GatewayWebAdminServer(OzoneConfigurationHolder.configuration(), "s3g-admin"); + adminHttpServer = new S3GatewayWebAdminServer(OzoneConfigurationHolder.configuration(), "s3g-web"); metrics = S3GatewayMetrics.create(OzoneConfigurationHolder.configuration()); start(); From 1e9a7a8f67d8c53907652ccd07e3b7f4ac11b7ca Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Thu, 10 Apr 2025 16:27:47 +0200 Subject: [PATCH 6/9] Revert "rename webhdfs to httpfs" This reverts commit 4a1e8ff59787aeae635b66e9758a2634b923cc61. --- .../org/apache/ozone/fs/http/server/HttpFSServerWebServer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/fs/http/server/HttpFSServerWebServer.java b/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/fs/http/server/HttpFSServerWebServer.java index 3f872a766749..0b6cf06dbdce 100644 --- a/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/fs/http/server/HttpFSServerWebServer.java +++ b/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/fs/http/server/HttpFSServerWebServer.java @@ -61,7 +61,7 @@ public class HttpFSServerWebServer { private static final String HTTP_ADMINS_KEY = "httpfs.http.administrators"; - private static final String NAME = "httpfs"; + private static final String NAME = "webhdfs"; private static final String SERVLET_PATH = "/webhdfs"; static { From 92c7cdeef85e668b0cde55fdeb9af9ab24efa23c Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Thu, 10 Apr 2025 16:28:13 +0200 Subject: [PATCH 7/9] Revert "revert renaming s3g-web to s3g-admin" This reverts commit ec12791952e7e54f065445cb98ecafaea5fe9f15. --- .../src/main/java/org/apache/hadoop/ozone/s3/Gateway.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 33965b4b159c..8a35798619be 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 @@ -81,7 +81,7 @@ public Void call() throws Exception { loginS3GUser(OzoneConfigurationHolder.configuration()); setHttpBaseDir(OzoneConfigurationHolder.configuration()); httpServer = new S3GatewayHttpServer(OzoneConfigurationHolder.configuration(), "s3gateway"); - adminHttpServer = new S3GatewayWebAdminServer(OzoneConfigurationHolder.configuration(), "s3g-web"); + adminHttpServer = new S3GatewayWebAdminServer(OzoneConfigurationHolder.configuration(), "s3g-admin"); metrics = S3GatewayMetrics.create(OzoneConfigurationHolder.configuration()); start(); From f87ce05e7063bde399bfb441c8c7e25a219e5a11 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Thu, 10 Apr 2025 16:28:13 +0200 Subject: [PATCH 8/9] Revert "rename s3g-web to s3g-admin" This reverts commit df184038e50e41bddd37b8b2a152102e82763d29. --- .../src/main/java/org/apache/hadoop/ozone/s3/Gateway.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 8a35798619be..0f89284bf5da 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 @@ -59,7 +59,7 @@ public class Gateway extends GenericCli implements Callable { private S3GatewayHttpServer httpServer; /** Servlets and static content on separate port. */ - private BaseHttpServer adminHttpServer; + private BaseHttpServer contentServer; private S3GatewayMetrics metrics; private final JvmPauseMonitor jvmPauseMonitor = newJvmPauseMonitor("S3G"); @@ -81,7 +81,7 @@ public Void call() throws Exception { loginS3GUser(OzoneConfigurationHolder.configuration()); setHttpBaseDir(OzoneConfigurationHolder.configuration()); httpServer = new S3GatewayHttpServer(OzoneConfigurationHolder.configuration(), "s3gateway"); - adminHttpServer = new S3GatewayWebAdminServer(OzoneConfigurationHolder.configuration(), "s3g-admin"); + contentServer = new S3GatewayWebAdminServer(OzoneConfigurationHolder.configuration(), "s3g-web"); metrics = S3GatewayMetrics.create(OzoneConfigurationHolder.configuration()); start(); @@ -105,13 +105,13 @@ public void start() throws IOException { HddsServerUtil.initializeMetrics(OzoneConfigurationHolder.configuration(), "S3Gateway"); jvmPauseMonitor.start(); httpServer.start(); - adminHttpServer.start(); + contentServer.start(); } public void stop() throws Exception { LOG.info("Stopping Ozone S3 gateway"); httpServer.stop(); - adminHttpServer.stop(); + contentServer.stop(); jvmPauseMonitor.stop(); S3GatewayMetrics.unRegister(); } From 5d9ff47caf9d8069451d189e70c4d1e5099d35e4 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Thu, 10 Apr 2025 16:29:12 +0200 Subject: [PATCH 9/9] update http.request logger names --- hadoop-ozone/dist/src/shell/conf/log4j.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hadoop-ozone/dist/src/shell/conf/log4j.properties b/hadoop-ozone/dist/src/shell/conf/log4j.properties index ce9e5d268d57..ae3c6f51cf3a 100644 --- a/hadoop-ozone/dist/src/shell/conf/log4j.properties +++ b/hadoop-ozone/dist/src/shell/conf/log4j.properties @@ -135,12 +135,12 @@ log4j.additivity.http.requests=false log4j.logger.http.requests=INFO,HttpAccess # Create separate appender for each co-hosted component if needed, then enable distinct logger configs: #log4j.logger.http.requests.hddsDatanode=INFO,HttpAccess -#log4j.logger.http.requests.httpfs=INFO,HttpAccess #log4j.logger.http.requests.ozoneManager=INFO,HttpAccess #log4j.logger.http.requests.recon=INFO,HttpAccess -#log4j.logger.http.requests.scm=INFO,HttpAccess #log4j.logger.http.requests.s3gateway=INFO,HttpAccess -#log4j.logger.http.requests.s3g-admin=INFO,HttpAccess +#log4j.logger.http.requests.s3g-web=INFO,HttpAccess +#log4j.logger.http.requests.scm=INFO,HttpAccess +#log4j.logger.http.requests.webhdfs=INFO,HttpAccess # Custom Logging levels # AWS SDK & S3A FileSystem