ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ja...@apache.org
Subject ambari git commit: AMBARI-14910: HAWQ hdfs-client.xml should be updated when NN HA in enabled (mithmatt via jaoki)
Date Fri, 05 Feb 2016 21:25:02 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 e417b5262 -> 360d5d2d4


AMBARI-14910: HAWQ hdfs-client.xml should be updated when NN HA in enabled (mithmatt via jaoki)


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

Branch: refs/heads/branch-2.2
Commit: 360d5d2d4c5add7073dfdeeeaf5cbed05d55d4b9
Parents: e417b52
Author: Jun Aoki <jaoki@apache.org>
Authored: Fri Feb 5 13:24:49 2016 -0800
Committer: Jun Aoki <jaoki@apache.org>
Committed: Fri Feb 5 13:24:49 2016 -0800

----------------------------------------------------------------------
 .../nameNode/rollback_controller.js             | 25 +++----
 .../nameNode/step3_controller.js                | 36 +++++++----
 .../nameNode/step9_controller.js                | 23 ++++---
 ambari-web/app/data/HDP2/ha_properties.js       | 68 +++++++++++++++++++-
 4 files changed, 119 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/360d5d2d/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
index 4aa2d73..b305845 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
@@ -268,17 +268,20 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
     });
   },
   restoreHawqConfigs: function(){
-    this.loadConfigTag("hawqSiteTag");
-    var hawqSiteTag = this.get("content.hawqSiteTag");
-    App.ajax.send({
-      name: 'admin.high_availability.load_hawq_configs',
-      sender: this,
-      data: {
-        hawqSiteTag: hawqSiteTag
-      },
-      success: 'onLoadHawqConfigs',
-      error: 'onTaskError'
-    });
+    var tags = ['hawqSiteTag', 'hdfsClientTag'];
+    tags.forEach(function (tagName) {
+      this.loadConfigTag(tagName);
+      var tag = this.get("content." + tagName);
+      App.ajax.send({
+        name: 'admin.high_availability.load_hawq_configs',
+        sender: this,
+        data: {
+          tagName: tag
+        },
+        success: 'onLoadHawqConfigs',
+        error: 'onTaskError'
+      });
+    }, this);
   },
 
   deletePXF: function(){

http://git-wip-us.apache.org/repos/asf/ambari/blob/360d5d2d/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 bf5b96a..5baf90f 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
@@ -88,6 +88,9 @@ App.HighAvailabilityWizardStep3Controller = Em.Controller.extend({
       var hawqSiteTag = data.Clusters.desired_configs['hawq-site'].tag;
       urlParams.push('(type=hawq-site&tag=' + hawqSiteTag + ')');
       this.set("hawqSiteTag", {name : "hawqSiteTag", value : hawqSiteTag});
+      var hdfsClientTag = data.Clusters.desired_configs['hdfs-client'].tag;
+      urlParams.push('(type=hdfs-client&tag=' + hdfsClientTag + ')');
+      this.set("hdfsClientTag", {name : "hdfsClientTag", value : hdfsClientTag});
     }
     App.ajax.send({
       name: 'admin.get.all_configurations',
@@ -111,8 +114,13 @@ App.HighAvailabilityWizardStep3Controller = Em.Controller.extend({
 
   tweakServiceConfigs: function(configs) {
     var nameServiceId = this.get('content.nameServiceId');
-    var nameServiceConfig = configs.findProperty('name','dfs.nameservices');
-    this.setConfigInitialValue(nameServiceConfig,nameServiceId);
+    var filesToChange = ['hdfs-site'];
+    // If HAWQ is on the cluster, update dfs.nameservices in hdfs-client.xml for HAWQ to
work with NN HA
+    if (App.Service.find().someProperty('serviceName', 'HAWQ')) filesToChange.push('hdfs-client');
+    filesToChange.forEach(function (filename) {
+      var nameServiceConfig = configs.filterProperty('filename', filename).findProperty('name','dfs.nameservices');
+      this.setConfigInitialValue(nameServiceConfig,nameServiceId);
+    }, this);
     var defaultFsConfig = configs.findProperty('name','fs.defaultFS');
     this.setConfigInitialValue(defaultFsConfig, "hdfs://" + nameServiceId);
     this.tweakServiceConfigNames(configs,nameServiceId);
@@ -151,15 +159,21 @@ App.HighAvailabilityWizardStep3Controller = Em.Controller.extend({
     if (this.get('serverConfigData').items.findProperty('type','zoo.cfg').properties['clientPort'])
       zkClientPort = this.get('serverConfigData').items.findProperty('type','zoo.cfg').properties['clientPort'];
 
-    var config = configs.findProperty('name','dfs.namenode.rpc-address.' + nameServiceId
+ '.nn1');
-    this.setConfigInitialValue(config,currentNameNodeHost + ':' + nnRpcPort);
-    config = configs.findProperty('name','dfs.namenode.rpc-address.' + nameServiceId + '.nn2');
-    this.setConfigInitialValue(config,newNameNodeHost + ':8020');
-    config = configs.findProperty('name','dfs.namenode.http-address.' + nameServiceId + '.nn1');
-    this.setConfigInitialValue(config,currentNameNodeHost + ':' + nnHttpPort);
-    config = configs.findProperty('name','dfs.namenode.http-address.' + nameServiceId + '.nn2');
-    this.setConfigInitialValue(config,newNameNodeHost + ':50070');
-    config = configs.findProperty('name','dfs.namenode.https-address.' + nameServiceId +
'.nn1');
+    var filesToChange = ['hdfs-site'];
+    // If HAWQ is on the cluster, update parameters in hdfs-client.xml for HAWQ to work with
NN HA
+    if (App.Service.find().someProperty('serviceName', 'HAWQ')) filesToChange.push('hdfs-client');
+    filesToChange.forEach(function (filename) {
+      var config = configs.filterProperty('filename', filename).findProperty('name','dfs.namenode.rpc-address.'
+ nameServiceId + '.nn1');
+      this.setConfigInitialValue(config,currentNameNodeHost + ':' + nnRpcPort);
+      config = configs.filterProperty('filename', filename).findProperty('name','dfs.namenode.rpc-address.'
+ nameServiceId + '.nn2');
+      this.setConfigInitialValue(config,newNameNodeHost + ':8020');
+      config = configs.filterProperty('filename', filename).findProperty('name','dfs.namenode.http-address.'
+ nameServiceId + '.nn1');
+      this.setConfigInitialValue(config,currentNameNodeHost + ':' + nnHttpPort);
+      config = configs.filterProperty('filename', filename).findProperty('name','dfs.namenode.http-address.'
+ nameServiceId + '.nn2');
+      this.setConfigInitialValue(config,newNameNodeHost + ':50070');
+    }, this);
+    
+    var config = configs.findProperty('name','dfs.namenode.https-address.' + nameServiceId
+ '.nn1');
     this.setConfigInitialValue(config,currentNameNodeHost + ':' + nnHttpsPort);
     config = configs.findProperty('name','dfs.namenode.https-address.' + nameServiceId +
'.nn2');
     this.setConfigInitialValue(config,newNameNodeHost + ':50470');

http://git-wip-us.apache.org/repos/asf/ambari/blob/360d5d2d/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
index 7745c6b..934d133 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
@@ -118,16 +118,19 @@ App.HighAvailabilityWizardStep9Controller = App.HighAvailabilityProgressPageCont
 
   reconfigureHawq: function () {
     var data = this.get('content.serviceConfigProperties');
-    var configData = this.reconfigureSites(['hawq-site'], data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE')));
-    App.ajax.send({
-      name: 'common.service.configurations',
-      sender: this,
-      data: {
-        desired_config: configData
-      },
-      success: 'saveConfigTag',
-      error: 'onTaskError'
-    });
+    var reconfigureFiles = ['hawq-site', 'hdfs-client'];
+    reconfigureFiles.forEach(function (fileName) {
+      var configData = this.reconfigureSites([fileName], data, Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE')));
+      App.ajax.send({
+        name: 'common.service.configurations',
+        sender: this,
+        data: {
+          desired_config: configData
+        },
+        success: 'saveConfigTag',
+        error: 'onTaskError'
+      });
+    }, this);
   },
 
   saveConfigTag: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/360d5d2d/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 8b2960d..9d268d9 100644
--- a/ambari-web/app/data/HDP2/ha_properties.js
+++ b/ambari-web/app/data/HDP2/ha_properties.js
@@ -28,7 +28,7 @@ module.exports =
       App.ServiceConfigCategory.create({ name: 'AMBARI_METRICS', displayName: 'Ambari Metrics'}),
       App.ServiceConfigCategory.create({ name: 'HAWQ', displayName: 'HAWQ'})
     ],
-    sites: ['core-site', 'hdfs-site', 'hbase-site', 'accumulo-site', 'ams-hbase-site', 'hawq-site'],
+    sites: ['core-site', 'hdfs-site', 'hbase-site', 'accumulo-site', 'ams-hbase-site', 'hawq-site',
'hdfs-client'],
     configs: [
     /**********************************************HDFS***************************************/
       {
@@ -263,6 +263,72 @@ module.exports =
         "category": "HAWQ",
         "filename": "hawq-site",
         "serviceName": 'MISC'
+      },
+      {
+        "name": "dfs.nameservices",
+        "displayName": "dfs.nameservices",
+        "description": "Comma-separated list of nameservices.",
+        "isReconfigurable": false,
+        "recommendedValue": "haCluster",
+        "value": "haCluster",
+        "category": "HAWQ",
+        "filename": "hdfs-client",
+        "serviceName": 'MISC'
+      },
+      {
+        "name": "dfs.ha.namenodes.${dfs.nameservices}",
+        "displayName": "dfs.ha.namenodes.${dfs.nameservices}",
+        "description": "The prefix for a given nameservice, contains a comma-separated list
of namenodes for a given nameservice.",
+        "isReconfigurable": false,
+        "recommendedValue": "nn1,nn2",
+        "value": "nn1,nn2",
+        "category": "HAWQ",
+        "filename": "hdfs-client",
+        "serviceName": 'MISC'
+      },
+      {
+        "name": "dfs.namenode.rpc-address.${dfs.nameservices}.nn1",
+        "displayName": "dfs.namenode.rpc-address.${dfs.nameservices}.nn1",
+        "description": "RPC address that handles all clients requests for nn1.",
+        "isReconfigurable": false,
+        "recommendedValue": "0.0.0.0:8020",
+        "value": "0.0.0.0:8020",
+        "category": "HAWQ",
+        "filename": "hdfs-client",
+        "serviceName": 'MISC'
+      },
+      {
+        "name": "dfs.namenode.rpc-address.${dfs.nameservices}.nn2",
+        "displayName": "dfs.namenode.rpc-address.${dfs.nameservices}.nn2",
+        "description": "RPC address that handles all clients requests for nn2.",
+        "isReconfigurable": false,
+        "recommendedValue": "0.0.0.0:8020",
+        "value": "0.0.0.0:8020",
+        "category": "HAWQ",
+        "filename": "hdfs-client",
+        "serviceName": 'MISC'
+      },
+      {
+        "name": "dfs.namenode.http-address.${dfs.nameservices}.nn1",
+        "displayName": "dfs.namenode.http-address.${dfs.nameservices}.nn1",
+        "description": "The fully-qualified HTTP address for nn1 NameNode.",
+        "isReconfigurable": false,
+        "recommendedValue": "0.0.0.0:50070",
+        "value": "0.0.0.0:50070",
+        "category": "HAWQ",
+        "filename": "hdfs-client",
+        "serviceName": 'MISC'
+      },
+      {
+        "name": "dfs.namenode.http-address.${dfs.nameservices}.nn2",
+        "displayName": "dfs.namenode.http-address.${dfs.nameservices}.nn2",
+        "description": "The fully-qualified HTTP address for nn2 NameNode.",
+        "isReconfigurable": false,
+        "recommendedValue": "0.0.0.0:50070",
+        "value": "0.0.0.0:50070",
+        "category": "HAWQ",
+        "filename": "hdfs-client",
+        "serviceName": 'MISC'
       }
     ]
   }


Mime
View raw message