hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomwh...@apache.org
Subject svn commit: r812491 - in /hadoop/hdfs/trunk: ./ src/java/org/apache/hadoop/hdfs/server/datanode/ src/java/org/apache/hadoop/hdfs/server/datanode/metrics/
Date Tue, 08 Sep 2009 13:05:27 GMT
Author: tomwhite
Date: Tue Sep  8 13:05:27 2009
New Revision: 812491

URL: http://svn.apache.org/viewvc?rev=812491&view=rev
Log:
HDFS-412. Hadoop JMX usage makes Nagios monitoring impossible. Contributed by Brian Bockelman.

Modified:
    hadoop/hdfs/trunk/CHANGES.txt
    hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
    hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/metrics/DataNodeActivityMBean.java
    hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/metrics/DataNodeMetrics.java

Modified: hadoop/hdfs/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=812491&r1=812490&r2=812491&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Tue Sep  8 13:05:27 2009
@@ -131,6 +131,9 @@
     HDFS-288. Redundant computation in hashCode() implementation.
     (szetszwo via tomwhite)
 
+    HDFS-412. Hadoop JMX usage makes Nagios monitoring impossible.
+    (Brian Bockelman via tomwhite)
+
   BUG FIXES
 
     HDFS-76. Better error message to users when commands fail because of 

Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java?rev=812491&r1=812490&r2=812491&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java (original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java Tue Sep
 8 13:05:27 2009
@@ -380,7 +380,7 @@
     this.infoServer.start();
     // adjust info port
     this.dnRegistration.setInfoPort(this.infoServer.getPort());
-    myMetrics = new DataNodeMetrics(conf, dnRegistration.getStorageID());
+    myMetrics = new DataNodeMetrics(conf, dnRegistration.getName());
     
     // set service-level authorization security policy
     if (conf.getBoolean(

Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/metrics/DataNodeActivityMBean.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/metrics/DataNodeActivityMBean.java?rev=812491&r1=812490&r2=812491&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/metrics/DataNodeActivityMBean.java
(original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/metrics/DataNodeActivityMBean.java
Tue Sep  8 13:05:27 2009
@@ -28,7 +28,7 @@
  * 
  * This is the JMX MBean for reporting the DataNode Activity.
  * The MBean is register using the name
- *        "hadoop:service=DataNode,name=DataNodeActivity-<storageid>"
+ *        "hadoop:service=DataNode,name=DataNodeActivity-<hostname>-<portNumber>"
  * 
  * Many of the activity metrics are sampled and averaged on an interval 
  * which can be specified in the metrics config file.
@@ -57,15 +57,17 @@
   final private ObjectName mbeanName;
   private Random rand = new Random(); 
 
-  public DataNodeActivityMBean(final MetricsRegistry mr, final String storageId) {
+  public DataNodeActivityMBean(final MetricsRegistry mr,
+      final String datanodeName) {
     super(mr, "Activity statistics at the DataNode");
-    String storageName;
-    if (storageId.equals("")) {// Temp fix for the uninitialized storage
-      storageName = "UndefinedStorageId" + rand.nextInt();
+    String name;
+    if (datanodeName.equals("")) {// Temp fix for the uninitialized name
+      name = "UndefinedDataNodeName" + rand.nextInt();
     } else {
-      storageName = storageId;
+      name = datanodeName.replace(":", "-");
     }
-    mbeanName = MBeanUtil.registerMBean("DataNode", "DataNodeActivity-" + storageName, this);
+    mbeanName = MBeanUtil.registerMBean("DataNode",
+	"DataNodeActivity-" + name, this);
   }
   
 

Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/metrics/DataNodeMetrics.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/metrics/DataNodeMetrics.java?rev=812491&r1=812490&r2=812491&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/metrics/DataNodeMetrics.java
(original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/metrics/DataNodeMetrics.java
Tue Sep  8 13:05:27 2009
@@ -90,14 +90,14 @@
                     new MetricsTimeVaryingRate("blockReports", registry);
 
     
-  public DataNodeMetrics(Configuration conf, String storageId) {
+  public DataNodeMetrics(Configuration conf, String datanodeName) {
     String sessionId = conf.get("session.id"); 
     // Initiate reporting of Java VM metrics
     JvmMetrics.init("DataNode", sessionId);
     
 
     // Now the MBean for the data node
-    datanodeActivityMBean = new DataNodeActivityMBean(registry, storageId);
+    datanodeActivityMBean = new DataNodeActivityMBean(registry, datanodeName);
     
     // Create record for DataNode metrics
     MetricsContext context = MetricsUtil.getContext("dfs");



Mime
View raw message