From d70d84570575574b7e3ad0f00baf54f1dde76d97 Mon Sep 17 00:00:00 2001 From: Xiaoyu Yao Date: Thu, 26 Jul 2018 13:17:37 -0700 Subject: [PATCH] HDDS-291. Initialize hadoop metrics system in standalone hdds datanodes. Contributed by Elek Marton. --- .../main/java/org/apache/hadoop/ozone/HddsDatanodeService.java | 2 ++ .../container/common/statemachine/SCMConnectionManager.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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 ddeec873bc..f359e729f1 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 @@ -26,6 +26,7 @@ import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.hdds.protocol.DatanodeDetails; import org.apache.hadoop.hdfs.DFSUtil; +import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem; import org.apache.hadoop.ozone.container.common.helpers.ContainerUtils; import org.apache.hadoop.ozone.container.common.statemachine .DatanodeStateMachine; @@ -241,6 +242,7 @@ public static void main(String[] args) { System.exit(1); } StringUtils.startupShutdownMessage(HddsDatanodeService.class, args, LOG); + DefaultMetricsSystem.initialize("HddsDatanode"); HddsDatanodeService hddsDatanodeService = createHddsDatanodeService(conf); hddsDatanodeService.start(null); diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/SCMConnectionManager.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/SCMConnectionManager.java index 19722f04a5..85fb580524 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/SCMConnectionManager.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/SCMConnectionManager.java @@ -67,7 +67,7 @@ public SCMConnectionManager(Configuration conf) { this.rpcTimeout = timeOut.intValue(); this.scmMachines = new HashMap<>(); this.conf = conf; - jmxBean = MBeans.register("OzoneDataNode", + jmxBean = MBeans.register("HddsDatanode", "SCMConnectionManager", this); }