diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 48a127580b..964658123b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -309,6 +309,9 @@ Release 2.7.0 - UNRELEASED HDFS-7283. Bump DataNode OOM log from WARN to ERROR. (Stephen Chu via wheat9) + HDFS-5928. Show namespace and namenode ID on NN dfshealth page. + (Siqi Li via wheat9) + OPTIMIZATIONS BUG FIXES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.html b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.html index 02858f1826..7798cba65f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.html +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.html @@ -116,15 +116,20 @@ {/nn} -{#nn} + +{#HAInfo} + + +{/HAInfo} +{#nn} -
Namespace:{Namespace}
Namenode ID:{NamenodeID}
Started:{NNStarted}
Version:{Version}
Compiled:{CompileInfo}
Cluster ID:{ClusterId}
Block Pool ID:{BlockPoolId}
{/nn} +

diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.js b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.js index e63c279b93..f6dc627db0 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.js +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.js @@ -54,6 +54,23 @@ var data = {}; + $.ajax({'url': '/conf', 'dataType': 'xml', 'async': false}).done( + function(d) { + var $xml = $(d); + var namespace, nnId; + $xml.find('property').each(function(idx,v) { + if ($(v).find('name').text() === 'dfs.nameservice.id') { + namespace = $(v).find('value').text(); + } + if ($(v).find('name').text() === 'dfs.ha.namenode.id') { + nnId = $(v).find('value').text(); + } + }); + if (namespace && nnId) { + data['HAInfo'] = {"Namespace": namespace, "NamenodeID": nnId}; + } + }); + // Workarounds for the fact that JMXJsonServlet returns non-standard JSON strings function workaround(nn) { nn.JournalTransactionInfo = JSON.parse(nn.JournalTransactionInfo);