You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2015/11/04 14:37:06 UTC

[39/50] [abbrv] ambari git commit: AMBARI-13700. hbase.root dir for metrics server does not get updated after NN HA is enabled

AMBARI-13700. hbase.root dir for metrics server does not get updated after NN HA is enabled


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/de3147d5
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/de3147d5
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/de3147d5

Branch: refs/heads/branch-dev-patch-upgrade
Commit: de3147d5dece64ab1c64366ef99f8a3de75afc96
Parents: 3cb80cf
Author: Alex Antonenko <hi...@gmail.com>
Authored: Tue Nov 3 19:13:33 2015 +0200
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Tue Nov 3 19:19:41 2015 +0200

----------------------------------------------------------------------
 .../nameNode/step3_controller.js                | 32 ++++++++++++++------
 ambari-web/app/data/HDP2/ha_properties.js       | 17 +++++++++--
 2 files changed, 38 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/de3147d5/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
index 20b6ce7..3cb7be7 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
@@ -79,6 +79,11 @@ App.HighAvailabilityWizardStep3Controller = Em.Controller.extend({
       urlParams.push('(type=accumulo-site&tag=' + accumuloSiteTag + ')');
       this.set("accumuloSiteTag", {name : "accumuloSiteTag", value : accumuloSiteTag});
     }
+    if (App.Service.find().someProperty('serviceName', 'AMBARI_METRICS')) {
+      var amsHbaseSiteTag = data.Clusters.desired_configs['ams-hbase-site'].tag;
+      urlParams.push('(type=ams-hbase-site&tag=' + amsHbaseSiteTag + ')');
+      this.set("amsHbaseSiteTag", {name : "amsHbaseSiteTag", value : amsHbaseSiteTag});
+    }
     App.ajax.send({
       name: 'admin.get.all_configurations',
       sender: this,
@@ -120,10 +125,12 @@ App.HighAvailabilityWizardStep3Controller = Em.Controller.extend({
   },
 
   tweakServiceConfigValues: function(configs,nameServiceId) {
-    var currentNameNodeHost = this.get('content.masterComponentHosts').filterProperty('component', 'NAMENODE').findProperty('isInstalled', true).hostName;
-    var newNameNodeHost = this.get('content.masterComponentHosts').filterProperty('component', 'NAMENODE').findProperty('isInstalled', false).hostName;
-    var journalNodeHosts = this.get('content.masterComponentHosts').filterProperty('component', 'JOURNALNODE').mapProperty('hostName');
-    var zooKeeperHosts = this.get('content.masterComponentHosts').filterProperty('component', 'ZOOKEEPER_SERVER').mapProperty('hostName');
+    var
+      value = "",
+      currentNameNodeHost = this.get('content.masterComponentHosts').filterProperty('component', 'NAMENODE').findProperty('isInstalled', true).hostName,
+      newNameNodeHost = this.get('content.masterComponentHosts').filterProperty('component', 'NAMENODE').findProperty('isInstalled', false).hostName,
+      journalNodeHosts = this.get('content.masterComponentHosts').filterProperty('component', 'JOURNALNODE').mapProperty('hostName'),
+      zooKeeperHosts = this.get('content.masterComponentHosts').filterProperty('component', 'ZOOKEEPER_SERVER').mapProperty('hostName');
     
     var nnHttpPort = 50070;
     if (this.get('serverConfigData').items.findProperty('type','hdfs-site').properties['dfs.namenode.http-address'])
@@ -154,23 +161,30 @@ App.HighAvailabilityWizardStep3Controller = Em.Controller.extend({
     this.setConfigInitialValue(config,'qjournal://' + journalNodeHosts[0] + ':8485;' + journalNodeHosts[1] + ':8485;' + journalNodeHosts[2] + ':8485/' + nameServiceId);
     config = configs.findProperty('name','ha.zookeeper.quorum');
     this.setConfigInitialValue(config,zooKeeperHosts[0] + ':' + zkClientPort + ',' + zooKeeperHosts[1] + ':' + zkClientPort + ',' + zooKeeperHosts[2] + ':'+ zkClientPort  );
-    config = configs.findProperty('name','hbase.rootdir');
     if (App.Service.find().someProperty('serviceName', 'HBASE')) {
-     var value = this.get('serverConfigData.items').findProperty('type', 'hbase-site').properties['hbase.rootdir'].replace(/\/\/[^\/]*/, '//' + nameServiceId);
+      config = configs.filterProperty('filename', 'hbase-site').findProperty('name','hbase.rootdir');
+      value = this.get('serverConfigData.items').findProperty('type', 'hbase-site').properties['hbase.rootdir'].replace(/\/\/[^\/]*/, '//' + nameServiceId);
      this.setConfigInitialValue(config,value);
     }
+    if (App.Service.find().someProperty('serviceName', 'AMBARI_METRICS')) {
+      config = configs.filterProperty('filename', 'ams-hbase-site').findProperty('name','hbase.rootdir');
+      value = this.get('serverConfigData.items').findProperty('type', 'ams-hbase-site').properties['hbase.rootdir'];
+      value = (value == "hdfs://" + currentNameNodeHost) ? "hdfs://" + nameServiceId : value;
+      config.isVisible = config.value != value ;
+      this.setConfigInitialValue(config,value);
+    }
     config = configs.findProperty('name','instance.volumes');
-    var config2 = configs.findProperty('name','instance.volumes.replacements');
+    config2 = configs.findProperty('name','instance.volumes.replacements');
     if (App.Service.find().someProperty('serviceName', 'ACCUMULO')) {
       var oldValue = this.get('serverConfigData.items').findProperty('type', 'accumulo-site').properties['instance.volumes'];
-      var value = oldValue.replace(/\/\/[^\/]*/, '//' + nameServiceId);
+      value = oldValue.replace(/\/\/[^\/]*/, '//' + nameServiceId);
       var replacements = oldValue + " " + value;
       this.setConfigInitialValue(config,value);
       this.setConfigInitialValue(config2,replacements)
     }
     config = configs.findProperty('name','dfs.journalnode.edits.dir');
     if (App.get('isHadoopWindowsStack') && App.Service.find().someProperty('serviceName', 'HDFS')) {
-     var value = this.get('serverConfigData.items').findProperty('type', 'hdfs-site').properties['dfs.journalnode.edits.dir'];
+     value = this.get('serverConfigData.items').findProperty('type', 'hdfs-site').properties['dfs.journalnode.edits.dir'];
      this.setConfigInitialValue(config, value);
     }
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/de3147d5/ambari-web/app/data/HDP2/ha_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/ha_properties.js b/ambari-web/app/data/HDP2/ha_properties.js
index dbbf81e..627018a 100644
--- a/ambari-web/app/data/HDP2/ha_properties.js
+++ b/ambari-web/app/data/HDP2/ha_properties.js
@@ -24,9 +24,10 @@ module.exports =
     configCategories: [
       App.ServiceConfigCategory.create({ name: 'HDFS', displayName: 'HDFS'}),
       App.ServiceConfigCategory.create({ name: 'HBASE', displayName: 'HBase'}),
-      App.ServiceConfigCategory.create({ name: 'ACCUMULO', displayName: 'Accumulo'})
+      App.ServiceConfigCategory.create({ name: 'ACCUMULO', displayName: 'Accumulo'}),
+      App.ServiceConfigCategory.create({ name: 'AMBARI_METRICS', displayName: 'Ambari Metrics'})
     ],
-    sites: ['core-site', 'hdfs-site', 'hbase-site', 'accumulo-site'],
+    sites: ['core-site', 'hdfs-site', 'hbase-site', 'accumulo-site', 'ams-hbase-site'],
     configs: [
     /**********************************************HDFS***************************************/
       {
@@ -237,6 +238,18 @@ module.exports =
         "category": "ACCUMULO",
         "filename": "accumulo-site",
         "serviceName": 'MISC'
+      },
+      {
+        "name": "hbase.rootdir",
+        "displayName": "hbase.rootdir",
+        "description": "Ambari Metrics service uses HBase as default storage backend. Set the rootdir for HBase to either local filesystem path if using Ambari Metrics in embedded mode or to a HDFS dir, example: hdfs://namenode.example.org:8020/amshbase.",
+        "isReconfigurable": false,
+        "recommendedValue": "file:///var/lib/ambari-metrics-collector/hbase",
+        "value": "file:///var/lib/ambari-metrics-collector/hbase",
+        "category": "AMBARI_METRICS",
+        "isVisible": false,
+        "filename": "ams-hbase-site",
+        "serviceName": 'MISC'
       }
     ]
   }