You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2013/09/10 19:09:54 UTC
git commit: AMBARI-3152. When NameNode HA is enabled and one NameNode
is down, a subset of HDFS metrics do not appear. (xiwang via yusaku)
Updated Branches:
refs/heads/trunk 6782de914 -> 3e962ea58
AMBARI-3152. When NameNode HA is enabled and one NameNode is down, a subset of HDFS metrics do not appear. (xiwang via yusaku)
Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/3e962ea5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/3e962ea5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/3e962ea5
Branch: refs/heads/trunk
Commit: 3e962ea58651ea9b134576646ac565a7c25cace0
Parents: 6782de9
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Tue Sep 10 10:09:36 2013 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Tue Sep 10 10:09:36 2013 -0700
----------------------------------------------------------------------
ambari-web/app/controllers/global/update_controller.js | 4 ++--
ambari-web/app/mappers/service_mapper.js | 12 ++++++++++++
2 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/3e962ea5/ambari-web/app/controllers/global/update_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/update_controller.js b/ambari-web/app/controllers/global/update_controller.js
index 3a33019..25fb267 100644
--- a/ambari-web/app/controllers/global/update_controller.js
+++ b/ambari-web/app/controllers/global/update_controller.js
@@ -101,8 +101,8 @@ App.UpdateController = Em.Controller.extend({
var testUrl = App.get('isHadoop2Stack') ? '/data/dashboard/HDP2/services.json':'/data/dashboard/services.json';
var servicesUrl = isInitialLoad ?
//this.getUrl('/data/dashboard/services.json', '/services?fields=components/ServiceComponentInfo,components/host_components,components/host_components/HostRoles') :
- this.getUrl(testUrl, '/services?fields=components/ServiceComponentInfo,components/host_components,components/host_components/HostRoles,components/host_components/metrics/jvm/memHeapUsedM,components/host_components/metrics/jvm/memHeapCommittedM,components/host_components/metrics/mapred/jobtracker/trackers_decommissioned,components/host_components/metrics/cpu/cpu_wio,components/host_components/metrics/rpc/RpcQueueTime_avg_time'+conditionalFieldsString) :
- this.getUrl(testUrl, '/services?fields=components/ServiceComponentInfo,components/host_components,components/host_components/HostRoles,components/host_components/metrics/jvm/memHeapUsedM,components/host_components/metrics/jvm/memHeapCommittedM,components/host_components/metrics/mapred/jobtracker/trackers_decommissioned,components/host_components/metrics/cpu/cpu_wio,components/host_components/metrics/rpc/RpcQueueTime_avg_time'+conditionalFieldsString);
+ this.getUrl(testUrl, '/services?fields=components/ServiceComponentInfo,components/host_components,components/host_components/HostRoles,components/host_components/metrics/jvm/memHeapUsedM,components/host_components/metrics/jvm/memHeapCommittedM,components/host_components/metrics/mapred/jobtracker/trackers_decommissioned,components/host_components/metrics/cpu/cpu_wio,components/host_components/metrics/rpc/RpcQueueTime_avg_time,components/host_components/metrics/dfs/FSNamesystem/HAState'+conditionalFieldsString) :
+ this.getUrl(testUrl, '/services?fields=components/ServiceComponentInfo,components/host_components,components/host_components/HostRoles,components/host_components/metrics/jvm/memHeapUsedM,components/host_components/metrics/jvm/memHeapCommittedM,components/host_components/metrics/mapred/jobtracker/trackers_decommissioned,components/host_components/metrics/cpu/cpu_wio,components/host_components/metrics/rpc/RpcQueueTime_avg_time,components/host_components/metrics/dfs/FSNamesystem/HAState'+conditionalFieldsString);
var callback = callback || function (jqXHR, textStatus) {
self.set('isUpdated', true);
};
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/3e962ea5/ambari-web/app/mappers/service_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/service_mapper.js b/ambari-web/app/mappers/service_mapper.js
index 9956481..509fa99 100644
--- a/ambari-web/app/mappers/service_mapper.js
+++ b/ambari-web/app/mappers/service_mapper.js
@@ -333,6 +333,18 @@ App.servicesMapper = App.QuickDataMapper.create({
var hdfsConfig = this.hdfsConfig;
item.components.forEach(function (component) {
if (component.ServiceComponentInfo && component.ServiceComponentInfo.component_name == "NAMENODE") {
+ // make active nameNode as host_components[0].
+ if ( component.host_components.length == 2) { //enabled HA
+ var haState2;
+ if (component.host_components[1].metrics.dfs) {
+ haState2 = component.host_components[1].metrics.dfs.FSNamesystem.HAState;
+ }
+ if (haState2 == "active") { // change places
+ var tmp = component.host_components[1];
+ component.host_components[1] = component.host_components[0];
+ component.host_components[0] = tmp;
+ }
+ }
item.nameNodeComponent = component;
finalConfig = jQuery.extend(finalConfig, hdfsConfig);
// Get the live, dead & decommission nodes from string json