diff --git a/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/HddsConfigKeys.java b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/HddsConfigKeys.java
index c265771805..184e3d880c 100644
--- a/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/HddsConfigKeys.java
+++ b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/HddsConfigKeys.java
@@ -227,4 +227,24 @@ private HddsConfigKeys() {
public static final String HDDS_SECURITY_CLIENT_SCM_CERTIFICATE_PROTOCOL_ACL =
"hdds.security.client.scm.certificate.protocol.acl";
+ public static final String HDDS_DATANODE_HTTP_ENABLED_KEY =
+ "hdds.datanode.http.enabled";
+ public static final String HDDS_DATANODE_HTTP_BIND_HOST_KEY =
+ "hdds.datanode.http-bind-host";
+ public static final String HDDS_DATANODE_HTTPS_BIND_HOST_KEY =
+ "hdds.datanode.https-bind-host";
+ public static final String HDDS_DATANODE_HTTP_ADDRESS_KEY =
+ "hdds.datanode.http-address";
+ public static final String HDDS_DATANODE_HTTPS_ADDRESS_KEY =
+ "hdds.datanode.https-address";
+
+ public static final String HDDS_DATANODE_HTTP_BIND_HOST_DEFAULT = "0.0.0.0";
+ public static final int HDDS_DATANODE_HTTP_BIND_PORT_DEFAULT = 9882;
+ public static final int HDDS_DATANODE_HTTPS_BIND_PORT_DEFAULT = 9883;
+ public static final String
+ HDDS_DATANODE_HTTP_KERBEROS_PRINCIPAL_KEY =
+ "hdds.datanode.http.kerberos.principal";
+ public static final String
+ HDDS_DATANODE_HTTP_KERBEROS_KEYTAB_FILE_KEY =
+ "hdds.datanode.http.kerberos.keytab";
}
\ No newline at end of file
diff --git a/hadoop-hdds/common/src/main/resources/ozone-default.xml b/hadoop-hdds/common/src/main/resources/ozone-default.xml
index f7fecb7b67..a4f49e762b 100644
--- a/hadoop-hdds/common/src/main/resources/ozone-default.xml
+++ b/hadoop-hdds/common/src/main/resources/ozone-default.xml
@@ -2029,6 +2029,70 @@
+
+ * 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.ozone; + +import java.io.IOException; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hdds.HddsConfigKeys; +import org.apache.hadoop.hdds.server.BaseHttpServer; + +/** + * Simple http server to provide basic monitoring for hdds datanode. + *
+ * This server is used to access default /conf /prom /prof endpoints.
+ */
+public class HddsDatanodeHttpServer extends BaseHttpServer {
+
+ public HddsDatanodeHttpServer(Configuration conf) throws IOException {
+ super(conf, "hddsDatanode");
+ }
+
+ @Override
+ protected String getHttpAddressKey() {
+ return HddsConfigKeys.HDDS_DATANODE_HTTP_ADDRESS_KEY;
+ }
+
+ @Override
+ protected String getHttpBindHostKey() {
+ return HddsConfigKeys.HDDS_DATANODE_HTTP_BIND_HOST_KEY;
+ }
+
+ @Override
+ protected String getHttpsAddressKey() {
+ return HddsConfigKeys.HDDS_DATANODE_HTTPS_ADDRESS_KEY;
+ }
+
+ @Override
+ protected String getHttpsBindHostKey() {
+ return HddsConfigKeys.HDDS_DATANODE_HTTPS_BIND_HOST_KEY;
+ }
+
+ @Override
+ protected String getBindHostDefault() {
+ return HddsConfigKeys.HDDS_DATANODE_HTTP_BIND_HOST_DEFAULT;
+ }
+
+ @Override
+ protected int getHttpBindPortDefault() {
+ return HddsConfigKeys.HDDS_DATANODE_HTTP_BIND_PORT_DEFAULT;
+ }
+
+ @Override
+ protected int getHttpsBindPortDefault() {
+ return HddsConfigKeys.HDDS_DATANODE_HTTPS_BIND_PORT_DEFAULT;
+ }
+
+ @Override
+ protected String getKeytabFile() {
+ return HddsConfigKeys.HDDS_DATANODE_HTTP_KERBEROS_KEYTAB_FILE_KEY;
+ }
+
+ @Override
+ protected String getSpnegoPrincipal() {
+ return HddsConfigKeys.HDDS_DATANODE_HTTP_KERBEROS_PRINCIPAL_KEY;
+ }
+
+ @Override
+ protected String getEnabledKey() {
+ return HddsConfigKeys.HDDS_DATANODE_HTTP_ENABLED_KEY;
+ }
+}
diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/HddsDatanodeService.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/HddsDatanodeService.java
index 3a92a4adf1..3c205e6540 100644
--- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/HddsDatanodeService.java
+++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/HddsDatanodeService.java
@@ -19,6 +19,7 @@
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
+
import org.apache.hadoop.conf.Configurable;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hdds.HddsUtils;
@@ -67,6 +68,7 @@ public class HddsDatanodeService extends GenericCli implements ServicePlugin {
private DatanodeDetails datanodeDetails;
private DatanodeStateMachine datanodeStateMachine;
private List
+ * 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.
+ */
\ No newline at end of file
diff --git a/hadoop-ozone/dist/src/main/compose/ozone/docker-compose.yaml b/hadoop-ozone/dist/src/main/compose/ozone/docker-compose.yaml
index 487c4eb29b..91105923dd 100644
--- a/hadoop-ozone/dist/src/main/compose/ozone/docker-compose.yaml
+++ b/hadoop-ozone/dist/src/main/compose/ozone/docker-compose.yaml
@@ -23,6 +23,7 @@ services:
- ../..:/opt/hadoop
ports:
- 9864
+ - 9882
command: ["/opt/hadoop/bin/ozone","datanode"]
env_file:
- ./docker-config
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java
index 0ed8e8b4d5..dbeb0b56e2 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java
@@ -577,6 +577,7 @@ private void configureOM() {
private void configureHddsDatanodes() {
conf.set(ScmConfigKeys.HDDS_REST_HTTP_ADDRESS_KEY, "0.0.0.0:0");
+ conf.set(HddsConfigKeys.HDDS_DATANODE_HTTP_ADDRESS_KEY, "0.0.0.0:0");
conf.set(HDDS_DATANODE_PLUGINS_KEY,
"org.apache.hadoop.ozone.web.OzoneHddsDatanodeService");
conf.setBoolean(OzoneConfigKeys.DFS_CONTAINER_IPC_RANDOM_PORT,